diff options
author | David Robillard <d@drobilla.net> | 2020-03-31 18:06:25 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-03-31 18:06:25 +0200 |
commit | ed0ef1d6d2c647684c13973c0faf8c17bfed3398 (patch) | |
tree | 6cd7cfe14580052857efb0c8518bdfffcdd0c862 | |
parent | 89323040a44834632f19bb4ea0039fc253061433 (diff) | |
download | pugl-ed0ef1d6d2c647684c13973c0faf8c17bfed3398.tar.gz pugl-ed0ef1d6d2c647684c13973c0faf8c17bfed3398.tar.bz2 pugl-ed0ef1d6d2c647684c13973c0faf8c17bfed3398.zip |
Add format attribute to logError()
-rw-r--r-- | test/test_utils.h | 9 |
1 files changed, 8 insertions, 1 deletions
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 <stdio.h> #include <string.h> +#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: "); |