Duke3d: VM_ASSERT fix

This commit is contained in:
Richard C. Gobeille 2020-05-09 14:02:12 -07:00 committed by Christoph Oelckers
parent 86e2f4ec8a
commit 7fbcab3dc1

View file

@ -1383,15 +1383,27 @@ static void ResizeArray(int const arrayNum, int const newSize)
# define abort_after_error(...) continue // non-threaded dispatch handles this in the loop condition in VM_Execute() # define abort_after_error(...) continue // non-threaded dispatch handles this in the loop condition in VM_Execute()
#endif #endif
#define VM_ASSERT(condition, ...) \ #if defined _MSC_VER
#define VM_ASSERT(condition, fmt, ...) \
do \ do \
{ \ { \
if (EDUKE32_PREDICT_FALSE(!(condition))) \ if (EDUKE32_PREDICT_FALSE(!(condition))) \
{ \ { \
CON_ERRPRINTF(__VA_ARGS__); \ CON_ERRPRINTF(fmt, __VA_ARGS__); \
abort_after_error(); \ abort_after_error(); \
} \ } \
} while (0) } while (0)
#else
#define VM_ASSERT(condition, fmt, ...) \
do \
{ \
if (EDUKE32_PREDICT_FALSE(!(condition))) \
{ \
CON_ERRPRINTF(fmt __VA_OPT__(, ) __VA_ARGS__); \
abort_after_error(); \
} \
} while (0)
#endif
GAMEEXEC_STATIC void VM_Execute(int const loop /*= false*/) GAMEEXEC_STATIC void VM_Execute(int const loop /*= false*/)
{ {