提交 f263d585 编写于 作者: P Palana

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

上级 3b3d612c
...@@ -47,9 +47,19 @@ EXPORT void base_set_log_handler( ...@@ -47,9 +47,19 @@ EXPORT void base_set_log_handler(
void (*handler)(enum log_type, const char *, va_list)); void (*handler)(enum log_type, const char *, va_list));
EXPORT void base_set_crash_handler(void (*handler)(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, ...); EXPORT void blog(enum log_type type, const char *format, ...);
PRINTFATTR(1, 2)
EXPORT void bcrash(const char *format, ...); EXPORT void bcrash(const char *format, ...);
#undef PRINTFATTR
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册