summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-23 17:46:04 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-08-23 17:46:04 (GMT)
commitf5fa04cbf3ac9011f4f144cd68543f8d9536e3fd (patch)
treeac9160ef7ef5963e296144fb75845db56ba62e7c /misc
parent061dd9094a903be73e3aa7a65aafb8bcb70010b7 (diff)
downloadeeshow-f5fa04cbf3ac9011f4f144cd68543f8d9536e3fd.zip
eeshow-f5fa04cbf3ac9011f4f144cd68543f8d9536e3fd.tar.gz
eeshow-f5fa04cbf3ac9011f4f144cd68543f8d9536e3fd.tar.bz2
misc/diag.h (BUG): more useful diagnostics; replace all "abort" with it
Diffstat (limited to 'misc')
-rw-r--r--misc/diag.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/misc/diag.h b/misc/diag.h
index 0184f15..5e2df87 100644
--- a/misc/diag.h
+++ b/misc/diag.h
@@ -23,6 +23,16 @@
extern unsigned verbose;
+/* ----- Internal errors --------------------------------------------------- */
+
+
+#define STRINGIFY(s) #s
+#define STRINGIFY_EXPAND(s) STRINGIFY(s)
+
+#define BUG(...) \
+ fatal("BUG " __FILE__ ":" STRINGIFY_EXPAND(__LINE__) ": " __VA_ARGS__)
+
+
/* ----- Specialized diagnostic functions ---------------------------------- */