From: TimePath Date: Wed, 28 Oct 2015 02:36:04 +0000 (+1100) Subject: With: allow in short if-else statements X-Git-Tag: xonotic-v0.8.2~1772 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=497f5e2303ea7803de85c2f44072acf0c3f71f5b;p=xonotic%2Fxonotic-data.pk3dir.git With: allow in short if-else statements --- diff --git a/qcsrc/lib/misc.qh b/qcsrc/lib/misc.qh index f6abd8e33..692ef2553 100644 --- a/qcsrc/lib/misc.qh +++ b/qcsrc/lib/misc.qh @@ -28,15 +28,14 @@ #define LAMBDA(...) { __VA_ARGS__; } -// Can't wrap with do-while as block may contain continue or break +// With block may not contain continue or break #define WITH(type, name, value, block) \ + do \ { \ type __with_save = (name); \ name = (value); \ LAMBDA(block) \ name = __with_save; \ - } do \ - { \ } \ while (0)