Use do { ... } while (0) for the *_LOG macros

Without this patch, such code would not compile:

if (cond)
    WARN_LOG(FOO, "msg");
else
    WARN_LOG(FOO, "msg2");
This commit is contained in:
Pierre Bourdon
2012-08-20 13:12:49 +02:00
parent 603bd9982d
commit 54fc4029dd
4 changed files with 9 additions and 9 deletions

View File

@ -88,9 +88,9 @@ struct TargetRectangle : public MathUtil::Rectangle<int>
};
#ifdef _WIN32
#define PRIM_LOG(...) {DEBUG_LOG(VIDEO, __VA_ARGS__)}
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, __VA_ARGS__)
#else
#define PRIM_LOG(...) {DEBUG_LOG(VIDEO, ##__VA_ARGS__)}
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, ##__VA_ARGS__)
#endif