From 56b3c46ba881208bf6832a6012fca7b3988268ef Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Thu, 2 Mar 2023 18:04:48 +0100 Subject: [PATCH] Fix MSVC non-Release builds (_alloca()/assert() didn't play nice) --- neo/idlib/Lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neo/idlib/Lib.h b/neo/idlib/Lib.h index 90287bad..5b2e999a 100644 --- a/neo/idlib/Lib.h +++ b/neo/idlib/Lib.h @@ -125,7 +125,8 @@ int IntForSixtets( byte *in ); #ifdef _DEBUG void AssertFailed( const char *file, int line, const char *expression ); #undef assert -#define assert( X ) if ( X ) { } else AssertFailed( __FILE__, __LINE__, #X ) +// DG: change assert to use ?: so I can use it in _alloca()/_alloca16() (MSVC didn't like if() in there) +#define assert( X ) (X) ? 1 : (AssertFailed( __FILE__, __LINE__, #X ), 0) #endif class idException {