diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-05-25 22:53:56 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-06-02 00:39:36 +0200 |
commit | 88d07b52fb6027ac6abecca863d06080a4c7b90f (patch) | |
tree | 3b0cfdc00c65f129768905ff43e3687ec4e08785 /dbg.h | |
parent | radix-trie: allow both ipv4 and ipv6 debug output (diff) | |
download | wg-dynamic-88d07b52fb6027ac6abecca863d06080a4c7b90f.tar.xz wg-dynamic-88d07b52fb6027ac6abecca863d06080a4c7b90f.zip |
Add BUG() and BUG_ON()
Diffstat (limited to 'dbg.h')
-rw-r--r-- | dbg.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -45,6 +45,9 @@ extern int DBG_LVL; #endif #define debug(...) do { if (DEBUG) log_err(__VA_ARGS__); } while (0) +#define BUG() do { __BUG(_FILENAME, __LINE__); abort(); } while (0) +#define __BUG(f,l) fprintf(stderr, "BUG: " f ":" STRINGIFY(l) "\n") +#define BUG_ON(cond) do { if (cond) BUG(); } while (0) #define assert_str_equal(a,b) ({ \ if (strcmp(a, b)) { \ |