mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-05 08:31:53 +00:00
More assertion categories
This commit is contained in:
parent
d607205486
commit
8029ae527e
@ -162,10 +162,14 @@ void debug(const char *msg, ...); /* Printf to debug output */
|
|||||||
#define DBG(x, y...) do { } while(0)
|
#define DBG(x, y...) do { } while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ASSERT_DIE(x) do { if (!(x)) bug("Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
|
||||||
|
|
||||||
#ifdef DEBUGGING
|
#ifdef DEBUGGING
|
||||||
#define ASSERT(x) do { if (!(x)) bug("Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
|
#define ASSERT(x) ASSERT_DIE(x)
|
||||||
|
#define ASSUME(x) ASSERT_DIE(x)
|
||||||
#else
|
#else
|
||||||
#define ASSERT(x) do { if (!(x)) log(L_BUG "Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
|
#define ASSERT(x) do { if (!(x)) log(L_BUG "Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
|
||||||
|
#define ASSUME(x) /* intentionally left blank */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUGGING
|
#ifdef DEBUGGING
|
||||||
|
Loading…
Reference in New Issue
Block a user