aboutsummaryrefslogtreecommitdiffstats
path: root/src/dbg.h
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2014-04-16 22:13:05 +0200
committerTharre <tharre3@gmail.com>2014-04-16 22:13:05 +0200
commit9e5c74c5711557b120945b5a2c0d6723d3427c20 (patch)
treedc366a6c93ce71c30209b74cf7f4e4184f450790 /src/dbg.h
parent3fbeb8a37f74bda763c7de2da63ae358fc0b1b0e (diff)
downloadredo-9e5c74c5711557b120945b5a2c0d6723d3427c20.tar.gz
redo-9e5c74c5711557b120945b5a2c0d6723d3427c20.tar.xz
redo-9e5c74c5711557b120945b5a2c0d6723d3427c20.zip
Rewrote malloc() and other wrappers
Diffstat (limited to 'src/dbg.h')
-rw-r--r--src/dbg.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dbg.h b/src/dbg.h
index 014c358..41bebb9 100644
--- a/src/dbg.h
+++ b/src/dbg.h
@@ -15,6 +15,8 @@
#define STRINGIFY(x) #x
#define LOG_HELPER(f,l,...) fprintf(stderr, "("f":"STRINGIFY(l)"): "__VA_ARGS__)
#define FATAL_HELPER(M, ...) log_err(M ": %s\n", __VA_ARGS__)
+#define FATAL_HELPER_(f,l,M,...) \
+ fprintf(stderr, "(%s:%u): " M ": %s\n", f, l, __VA_ARGS__)
#ifdef NDEBUG
#define debug(...)
@@ -23,6 +25,9 @@
#endif
#define log_err(...) LOG_HELPER(__FILENAME__, __LINE__, __VA_ARGS__)
-#define fatal(...) {FATAL_HELPER(__VA_ARGS__, strerror(errno)); exit(EXIT_FAILURE);}
+#define fatal(...) \
+ {FATAL_HELPER(__VA_ARGS__, strerror(errno)); exit(EXIT_FAILURE);}
+#define fatal_(f,l,...) \
+ {FATAL_HELPER_(f, l, __VA_ARGS__, strerror(errno)); exit(EXIT_FAILURE);}
#endif