Fix -DNDEBUG support

Change-Id: Ib64cef83a646bce2b0afa72b607fb9e5c306e859
This commit is contained in:
2014-08-22 19:11:59 +02:00
parent 222afb38ac
commit 3260d16f34
20 changed files with 117 additions and 23 deletions

View File

@@ -171,7 +171,10 @@ sqlite::statement::~statement(void)
void
sqlite::statement::step_without_results(void)
{
const bool data = step();
#if defined(__minix) && !defined(NDEBUG)
const bool data =
#endif /* defined(__minix) && !defined(NDEBUG) */
step();
INV_MSG(!data, "The statement should not have produced any rows, but it "
"did");
}
@@ -610,6 +613,14 @@ void
sqlite::statement::clear_bindings(void)
{
const int error = ::sqlite3_clear_bindings(_pimpl->stmt);
#if defined(__minix) && defined(NDEBUG)
#undef PRE_MSG
#define PRE_MSG(expr, msg) \
do { \
if (!(expr)) \
utils::sanity_failure(utils::precondition, __FILE__, __LINE__, msg); \
} while (0)
#endif /* defined(__minix) && defined(NDEBUG) */
PRE_MSG(error == SQLITE_OK, "SQLite3 contract has changed; it should "
"only return SQLITE_OK");
}