diff options
Diffstat (limited to 'lib/zassert.h')
-rw-r--r-- | lib/zassert.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/zassert.h b/lib/zassert.h index 8ca2203f..ee36a98e 100644 --- a/lib/zassert.h +++ b/lib/zassert.h @@ -5,6 +5,7 @@ #ifndef _QUAGGA_ASSERT_H #define _QUAGGA_ASSERT_H +#include "misc.h" #include "confirm.h" extern void _zlog_assert_failed (const char *assertion, const char *file, @@ -33,7 +34,7 @@ extern void _zlog_abort_err (const char *mess, int err, const char *file, #define zassert(EX) ((void)((EX) ? 0 : \ (_zlog_assert_failed(#EX, __FILE__, __LINE__, \ - __ASSERT_FUNCTION), 0))) + __ASSERT_FUNCTION), 0))) /* Implicitly *permanent* assert() -- irrespective of NDEBUG */ #undef assert @@ -44,11 +45,14 @@ extern void _zlog_abort_err (const char *mess, int err, const char *file, /* NDEBUG time assert() */ #ifndef NDEBUG -#define dassert(EX) zassert(EX) +# define dassert(EX) zassert(EX) #else -#define dassert(EX) +# define dassert(EX) #endif +/* Assert iff QDEBUG */ +#define qassert(EX) zassert(qdebug && (EX)) + /* Abort with message */ #define zabort(MS) _zlog_abort_mess(MS, __FILE__, __LINE__, __ASSERT_FUNCTION) |