Rework TRACEF format, handle empty varargs (GNU extension)

This commit is contained in:
Nils Olav Selåsdal
2013-01-15 15:54:43 +01:00
parent 63a986f89c
commit cd61803c9a
+3 -2
View File
@@ -10,9 +10,10 @@
} while (0) } while (0)
#ifdef DEBUG #ifdef DEBUG
#define TRACEF(fmt, ...)\ #define TRACEF(fmt, args...)
do { \ do { \
fprintf(stderr, "%s:%s(%d)" fmt, __FILE__, __FUNCTION__, __LINE,__VA_ARGS__);\ fprintf(stdout, "%s:%d (%s)\t" fmt, __FILE__, __LINE__, __FUNCTION__, ##args);\
fflush(stdout);\
} while(0) } while(0)
#else #else
#define TRACEF(fmt, ...) #define TRACEF(fmt, ...)