aboutsummaryrefslogtreecommitdiffstats
path: root/dbg.h
diff options
context:
space:
mode:
Diffstat (limited to 'dbg.h')
-rw-r--r--dbg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/dbg.h b/dbg.h
index fa55ee9..2d32033 100644
--- a/dbg.h
+++ b/dbg.h
@@ -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)) { \