From 1aa20487a4b8924bff7343b4a6e8f1a5fa89b837 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 3 Jun 2017 12:02:29 -0400 Subject: [PATCH] autoupdater: Fixed up GCC/clang printf function attribute. --- code/autoupdater/autoupdater.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/code/autoupdater/autoupdater.c b/code/autoupdater/autoupdater.c index eb7937ee..0e8392b8 100644 --- a/code/autoupdater/autoupdater.c +++ b/code/autoupdater/autoupdater.c @@ -75,8 +75,10 @@ typedef pid_t PID; #if defined(__GNUC__) || defined(__clang__) #define NEVER_RETURNS __attribute__((noreturn)) +#define PRINTF_FUNC(fmtargnum, dotargnum) __attribute__ (( format( __printf__, fmtargnum, dotargnum ))) #else #define NEVER_RETURNS +#define PRINTF_FUNC(fmtargnum, dotargnum) #endif @@ -134,8 +136,6 @@ static const char *timestamp(void) static FILE *logfile = NULL; -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) - static void info(const char *str) { fputs(str, logfile); @@ -143,12 +143,7 @@ static void info(const char *str) fflush(logfile); } -static void infof(const char *fmt, ...) -#if defined(__GNUC__) || defined(__clang__) -__attribute__ (( format( __printf__, 1, 2 ))) -#endif -; - +static void infof(const char *fmt, ...) PRINTF_FUNC(1, 2); static void infof(const char *fmt, ...) { va_list ap;