Moved the define at the top

This commit is contained in:
Davide Paro 2021-02-12 00:25:34 +01:00 committed by GitHub
parent 3e5970eb11
commit 815e0d909d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,14 @@
#define LOG_VERSION "0.1.0" #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 { typedef struct {
va_list ap; va_list ap;
const char *fmt; 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_callback(log_LogFn fn, void *udata, int level);
int log_add_fp(FILE *fp, int level); int log_add_fp(FILE *fp, int level);
#define RXI_LOGC_FMT_ATTRIB(n, m)
#if defined __GNUC__ void log_log(int level, const char *file, int line, const char *fmt, ...) RXI_LOGC_PRINTF_ATTRIB(4, 5);
# 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);
#endif #endif