enable format string diagnostics for blog and bcrash on gcc and clang

This commit is contained in:
Palana
2013-11-14 18:31:18 +01:00
parent 3b3d612ceb
commit f263d585bf
+10
View File
@@ -47,9 +47,19 @@ EXPORT void base_set_log_handler(
void (*handler)(enum log_type, const char *, va_list));
EXPORT void base_set_crash_handler(void (*handler)(const char *, va_list));
#ifndef _MSC_VER
#define PRINTFATTR(f, a) __attribute__((__format__(__printf__, f, a)))
#else
#define PRINTFATTR(f, a)
#endif
PRINTFATTR(2, 3)
EXPORT void blog(enum log_type type, const char *format, ...);
PRINTFATTR(1, 2)
EXPORT void bcrash(const char *format, ...);
#undef PRINTFATTR
#ifdef __cplusplus
}
#endif