mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-28 03:44:52 +08:00
enable format string diagnostics for blog and bcrash on gcc and clang
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user