From ed0ef1d6d2c647684c13973c0faf8c17bfed3398 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Mar 2020 18:06:25 +0200 Subject: Add format attribute to logError() --- test/test_utils.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test_utils.h b/test/test_utils.h index 2b470cb..7d33601 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -25,6 +25,12 @@ #include #include +#ifdef __GNUC__ +# define PUGL_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) +#else +# define PUGL_LOG_FUNC(fmt, arg1) +#endif + typedef struct { int samples; int doubleBuffer; @@ -37,7 +43,8 @@ typedef struct { bool errorChecking; } PuglTestOptions; -static inline int +PUGL_LOG_FUNC(1, 2) +static int logError(const char* fmt, ...) { fprintf(stderr, "error: "); -- cgit v1.2.1