GCC style printf attrib for checking correct usage of format arguments
Defined RXI_LOGC_FMT_ATTRIB which expands to nothing in case __GNUC__ is not defined. It's purpose is to provide printf style checking enforced from the compiler where supported
This commit is contained in:
parent
f9ea34994b
commit
3e5970eb11
@ -44,6 +44,13 @@ 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);
|
||||||
|
|
||||||
void log_log(int level, const char *file, int line, const char *fmt, ...);
|
#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);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user