diff options
Diffstat (limited to '')
-rw-r--r-- | src/Generating/PrefabPiecePool.cpp | 10 | ||||
-rw-r--r-- | src/Generating/VerticalLimit.cpp | 10 | ||||
-rw-r--r-- | src/Generating/VerticalStrategy.cpp | 10 |
3 files changed, 18 insertions, 12 deletions
diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index ed5283dec..d984912cb 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -16,10 +16,12 @@ // Conditionally log a warning #define CONDWARNING(ShouldLog, ...) \ - if (ShouldLog) \ - { \ - LOGWARNING(__VA_ARGS__); \ - } + do { \ + if (ShouldLog) \ + { \ + LOGWARNING(__VA_ARGS__); \ + } \ + } while (false) diff --git a/src/Generating/VerticalLimit.cpp b/src/Generating/VerticalLimit.cpp index 5cc003749..0d27c85bf 100644 --- a/src/Generating/VerticalLimit.cpp +++ b/src/Generating/VerticalLimit.cpp @@ -10,10 +10,12 @@ // Emit a warning if the first param is true #define CONDWARNING(ShouldLog, Fmt, ...) \ - if (ShouldLog) \ - { \ - LOGWARNING(Fmt, __VA_ARGS__); \ - } + do { \ + if (ShouldLog) \ + { \ + LOGWARNING(Fmt, __VA_ARGS__); \ + } \ + } while (false) diff --git a/src/Generating/VerticalStrategy.cpp b/src/Generating/VerticalStrategy.cpp index 4021dc4bb..fa85a05d7 100644 --- a/src/Generating/VerticalStrategy.cpp +++ b/src/Generating/VerticalStrategy.cpp @@ -20,10 +20,12 @@ static const int SEED_OFFSET = 135; // Emit a warning if the first param is true #define CONDWARNING(ShouldLog, Fmt, ...) \ - if (ShouldLog) \ - { \ - LOGWARNING(Fmt, __VA_ARGS__); \ - } + do { \ + if (ShouldLog) \ + { \ + LOGWARNING(Fmt, __VA_ARGS__); \ + } \ + } while (false) |