Commit 6de0e9b5 authored by Oleg Kolosov's avatar Oleg Kolosov

Wrap KJ_LOG in braces

This fixes "dangling else" warnings when KJ_LOG is used after unbraced if statement.
parent ab359776
......@@ -131,9 +131,9 @@ namespace kj {
#define KJ_EXPAND(X) X
#define KJ_LOG(severity, ...) \
if (!::kj::_::Debug::shouldLog(::kj::LogSeverity::severity)) {} else \
{ if (!::kj::_::Debug::shouldLog(::kj::LogSeverity::severity)) {} else \
::kj::_::Debug::log(__FILE__, __LINE__, ::kj::LogSeverity::severity, \
"" #__VA_ARGS__, __VA_ARGS__)
"" #__VA_ARGS__, __VA_ARGS__); }
#define KJ_DBG(...) KJ_EXPAND(KJ_LOG(DBG, __VA_ARGS__))
......@@ -210,9 +210,9 @@ namespace kj {
#else
#define KJ_LOG(severity, ...) \
if (!::kj::_::Debug::shouldLog(::kj::LogSeverity::severity)) {} else \
{ if (!::kj::_::Debug::shouldLog(::kj::LogSeverity::severity)) {} else \
::kj::_::Debug::log(__FILE__, __LINE__, ::kj::LogSeverity::severity, \
#__VA_ARGS__, ##__VA_ARGS__)
#__VA_ARGS__, ##__VA_ARGS__); }
#define KJ_DBG(...) KJ_LOG(DBG, ##__VA_ARGS__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment