diff options
| author | Léo Lam <leolino.lam@gmail.com> | 2018-04-16 20:38:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-16 20:38:22 +0200 |
| commit | dfd6a228a69021ca88daaee2de457871f77f8c77 (patch) | |
| tree | 84b80da36c2c5e4ae30ff5d5a2d8c0894e21c72e /Source/Core/Common/Logging | |
| parent | d13fc1d2e9f71888b117bc9e4fee7acf885feb18 (diff) | |
| parent | b0dc823472dcc159c2020bab088dd2c891b36375 (diff) | |
Merge pull request #6654 from lioncash/log
Common/Logging/Log: Wrap GENERIC_LOG macro's body in do { } while (0)
Diffstat (limited to 'Source/Core/Common/Logging')
| -rw-r--r-- | Source/Core/Common/Logging/Log.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index c2dd70937e..7e7b295a52 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -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) |
