diff --git a/src/log.h b/src/log.h index 64dccd7..bc48712 100644 --- a/src/log.h +++ b/src/log.h @@ -15,6 +15,14 @@ #define LOG_VERSION "0.1.0" +#define RXI_LOGC_PRINTF_ATTRIB(n, m) + +#if defined __GNUC__ +# define RXI_LOGC_PRINTF_ATTRIB(n, m) __attribute__((format(printf, n, m))) +#endif + + + typedef struct { va_list ap; const char *fmt; @@ -44,13 +52,7 @@ void log_set_quiet(bool enable); int log_add_callback(log_LogFn fn, void *udata, int level); int log_add_fp(FILE *fp, int level); -#define RXI_LOGC_FMT_ATTRIB(n, m) -#if defined __GNUC__ -# define RXI_LOGC_FMT_ATTRIB(n, m) __attribute__((format(printf, n, m))) -#endif - - -void log_log(int level, const char *file, int line, const char *fmt, ...) RXI_LOGC_FMT_ATTRIB(4, 5); +void log_log(int level, const char *file, int line, const char *fmt, ...) RXI_LOGC_PRINTF_ATTRIB(4, 5); #endif