Commit fc43c041 authored by Richard Gobeille's avatar Richard Gobeille

Duke3d: remove the do {} while (0) from the VM_ASSERT macro

This makes the macro less flexible, but I'm not sure that using __builtin_expect within the loop is doing what I want. I guess I should fire up godbolt.org...
parent 6dc2eaea
......@@ -1285,25 +1285,19 @@ static void ResizeArray(int const arrayNum, int const newSize)
#endif
#if defined _MSC_VER
#define VM_ASSERT(condition, fmt, ...) \
do \
{ \
if (EDUKE32_PREDICT_FALSE(!(condition))) \
{ \
CON_ERRPRINTF(fmt, __VA_ARGS__); \
abort_after_error(); \
} \
} while (0)
#define VM_ASSERT(condition, fmt, ...) \
if (EDUKE32_PREDICT_FALSE(!(condition))) \
{ \
CON_ERRPRINTF(fmt, __VA_ARGS__); \
abort_after_error(); \
}
#else
#define VM_ASSERT(condition, ...) \
do \
{ \
if (EDUKE32_PREDICT_FALSE(!(condition))) \
{ \
CON_ERRPRINTF(__VA_ARGS__); \
abort_after_error(); \
} \
} while (0)
#define VM_ASSERT(condition, ...) \
if (EDUKE32_PREDICT_FALSE(!(condition))) \
{ \
CON_ERRPRINTF(__VA_ARGS__); \
abort_after_error(); \
}
#endif
GAMEEXEC_STATIC void VM_Execute(int const loop /*= false*/)
......
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