commit c5fef4955facb3aca17176f5e0df090ecf9108a4
parent 2e184868706ddf4e9294cce2640dd0636d76be91
Author: vaplv <vaplv@free.fr>
Date: Fri, 3 Jul 2020 11:47:36 +0200
Add the VFATAL macro
It is similar to the FATAL macro with an additional variadic macro
argument that allow to format the printed message as "printf".
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/rsys.h b/src/rsys.h
@@ -220,13 +220,15 @@
[1 - 2*(!(Cond))];
#endif
-#define FATAL(Msg) \
+#define VFATAL(Fmt, Args) \
{ \
- fprintf(stderr, Msg); \
+ fprintf(stderr, Fmt COMMA_##Args LIST_##Args); \
ASSERT(0); \
abort(); \
} (void)0
+#define FATAL(Msg) VFATAL(Msg, ARG0())
+
#define CHK(Cond) \
{ \
if(!(Cond)) \