]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
More assertion categories
authorMaria Matejka <mq@ucw.cz>
Thu, 1 Aug 2019 12:25:01 +0000 (14:25 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 28 Apr 2020 14:21:06 +0000 (16:21 +0200)
lib/birdlib.h

index 5202b0c8b2ae20765b73ce5255801990f49a96a9..4adc42cdbd0b6c797c0f3b4c2f2ae0abd2cab6ba 100644 (file)
@@ -162,10 +162,14 @@ void debug(const char *msg, ...); /* Printf to debug output */
 #define DBG(x, y...) do { } while(0)
 #endif
 
+#define ASSERT_DIE(x) do { if (!(x)) bug("Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
+
 #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
 #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
 
 #ifdef DEBUGGING