diff options
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/assert.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/lib/utils/assert.h b/src/lib/utils/assert.h index 8211ec262..d23558cd0 100644 --- a/src/lib/utils/assert.h +++ b/src/lib/utils/assert.h @@ -1,6 +1,6 @@ /* * Runtime assertion checking -* (C) 2010 Jack Lloyd +* (C) 2010,2018 Jack Lloyd * 2017 Simon Warta (Kullo GmbH) * * Botan is released under the Simplified BSD License (see license.txt) @@ -17,11 +17,12 @@ namespace Botan { /** * Called when an assertion fails */ -BOTAN_NORETURN void BOTAN_PUBLIC_API(2,0) assertion_failure(const char* expr_str, - const char* assertion_made, - const char* func, - const char* file, - int line); +BOTAN_NORETURN void BOTAN_PUBLIC_API(2,0) + assertion_failure(const char* expr_str, + const char* assertion_made, + const char* func, + const char* file, + int line); /** * Make an assertion @@ -88,6 +89,16 @@ BOTAN_NORETURN void BOTAN_PUBLIC_API(2,0) assertion_failure(const char* expr_str __LINE__); \ } while(0) +#if defined(BOTAN_ENABLE_DEBUG_ASSERTS) + +#define BOTAN_DEBUG_ASSERT(expr) BOTAN_ASSERT_NOMSG(expr) + +#else + +#define BOTAN_DEBUG_ASSERT(expr) do {} while(0) + +#endif + /** * Mark variable as unused. Takes between 1 and 9 arguments and marks all as unused, * e.g. BOTAN_UNUSED(a); or BOTAN_UNUSED(x, y, z); |