diff options
author | Tharre <tharre3@gmail.com> | 2014-04-16 22:13:05 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2014-04-16 22:13:05 +0200 |
commit | 9e5c74c5711557b120945b5a2c0d6723d3427c20 (patch) | |
tree | dc366a6c93ce71c30209b74cf7f4e4184f450790 /src/dbg.h | |
parent | 3fbeb8a37f74bda763c7de2da63ae358fc0b1b0e (diff) | |
download | redo-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.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |