mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-29 12:55:43 -04:00
Add printf-like macro.
This should help catch some formatting bugs.
This commit is contained in:
parent
05545566e7
commit
01b3b5066d
@ -46,7 +46,7 @@ void SetFilterLevel(LOGLEVEL level);
|
|||||||
|
|
||||||
// writes a message to the log
|
// writes a message to the log
|
||||||
void Write(const char* channelName, const char* functionName, LOGLEVEL level, const char* message);
|
void Write(const char* channelName, const char* functionName, LOGLEVEL level, const char* message);
|
||||||
void Writef(const char* channelName, const char* functionName, LOGLEVEL level, const char* format, ...);
|
void Writef(const char* channelName, const char* functionName, LOGLEVEL level, const char* format, ...) printflike(4, 5);
|
||||||
void Writev(const char* channelName, const char* functionName, LOGLEVEL level, const char* format, va_list ap);
|
void Writev(const char* channelName, const char* functionName, LOGLEVEL level, const char* format, va_list ap);
|
||||||
} // namespace Log
|
} // namespace Log
|
||||||
|
|
||||||
|
@ -49,6 +49,12 @@ char (&__countof_ArraySizeHelper(T (&array)[N]))[N];
|
|||||||
#define offsetof(st, m) ((size_t)((char*)&((st*)(0))->m - (char*)0))
|
#define offsetof(st, m) ((size_t)((char*)&((st*)(0))->m - (char*)0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define printflike(n,m) __attribute__((format(printf,n,m)))
|
||||||
|
#else
|
||||||
|
#define printflike(n,m)
|
||||||
|
#endif
|
||||||
|
|
||||||
// disable warnings that show up at warning level 4
|
// disable warnings that show up at warning level 4
|
||||||
// TODO: Move to build system instead
|
// TODO: Move to build system instead
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user