summaryrefslogtreecommitdiffstats
path: root/src/diag.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/diag.h')
-rw-r--r--src/diag.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/diag.h b/src/diag.h
index 645dbb1..0a4d3b9 100644
--- a/src/diag.h
+++ b/src/diag.h
@@ -18,6 +18,7 @@
*
* bfs: func@src/file.c:0: Message
*/
+// Use (format) ? "..." : "" so the format string is required
#define BFS_DIAG_FORMAT_(format) \
((format) ? "%s: %s@%s:%d: " format "%s" : "")
@@ -75,7 +76,7 @@ void bfs_abortf(const char *format, ...);
bfs_eabort_(__VA_ARGS__, )
#define bfs_eabort_(format, ...) \
- ((format) ? bfs_abort_(format ": %s", __VA_ARGS__ errstr(), ) : (void)0)
+ bfs_abort_(format "%s%s", __VA_ARGS__ (sizeof("" format) > 1 ? ": " : ""), errstr(), )
/**
* Abort in debug builds; no-op in release builds.
@@ -116,7 +117,6 @@ void bfs_abortf(const char *format, ...);
#define bfs_everify(...) \
bfs_everify_(#__VA_ARGS__, __VA_ARGS__, "", )
-
#define bfs_everify_(str, cond, format, ...) \
((cond) ? (void)0 : bfs_everify__(format, BFS_DIAG_MSG_(format, str), __VA_ARGS__))