tests/utils_tests.h: add VA_ARGS versions of variadic macros
authorPaul Brossier <piem@piem.org>
Sat, 23 Apr 2016 16:27:44 +0000 (18:27 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 23 Apr 2016 16:27:44 +0000 (18:27 +0200)
tests/utils_tests.h

index 07f0719..edfe4f7 100644 (file)
@@ -5,10 +5,17 @@
 #include <assert.h>
 #include "config.h"
 
+#ifdef HAVE_C99_VARARGS_MACROS
+#define PRINT_ERR(...)   fprintf(stderr, "AUBIO-TESTS ERROR: " __VA_ARGS__)
+#define PRINT_MSG(...)   fprintf(stdout, __VA_ARGS__)
+#define PRINT_DBG(...)   fprintf(stderr, __VA_ARGS__)
+#define PRINT_WRN(...)   fprintf(stderr, "AUBIO-TESTS WARNING: " __VA_ARGS__)
+#else
 #define PRINT_ERR(format, args...)   fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args)
 #define PRINT_MSG(format, args...)   fprintf(stdout, format , ##args)
 #define PRINT_DBG(format, args...)   fprintf(stderr, format , ##args)
 #define PRINT_WRN(format, args...)   fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args)
+#endif
 
 #ifdef HAVE_WIN_HACKS
 // http://en.wikipedia.org/wiki/Linear_congruential_generator