mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #6654 from lioncash/log
Common/Logging/Log: Wrap GENERIC_LOG macro's body in do { } while (0)
This commit is contained in:
@ -91,33 +91,34 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char*
|
||||
|
||||
// Let the compiler optimize this out
|
||||
#define GENERIC_LOG(t, v, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (v <= MAX_LOGLEVEL) \
|
||||
GenericLog(v, t, __FILE__, __LINE__, __VA_ARGS__); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define ERROR_LOG(t, ...) \
|
||||
do \
|
||||
{ \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define WARN_LOG(t, ...) \
|
||||
do \
|
||||
{ \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define NOTICE_LOG(t, ...) \
|
||||
do \
|
||||
{ \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__) \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define INFO_LOG(t, ...) \
|
||||
do \
|
||||
{ \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define DEBUG_LOG(t, ...) \
|
||||
do \
|
||||
{ \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) \
|
||||
GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
Reference in New Issue
Block a user