diff --git a/tools/quake3/common/cmdlib.h b/tools/quake3/common/cmdlib.h index 02af1745..507366bb 100644 --- a/tools/quake3/common/cmdlib.h +++ b/tools/quake3/common/cmdlib.h @@ -171,11 +171,11 @@ void ExpandWildcards( int *argc, char ***argv ); double I_FloatTime( void ); -void Error( const char *error, ... ) -#ifdef __GNUC__ -__attribute__( ( noreturn ) ) -#endif -; +[[ noreturn ]] void Error( const char *error, ... ); +#define ENSURE( condition ) \ + (void) \ + ( (!!( condition )) || \ + (Error( "%s:%u:%s: Condition '%s' failed.", __FILE__, __LINE__, __func__, #condition ), 0) ) FILE *SafeOpenWrite( const char *filename, const char *mode = "wb" ); FILE *SafeOpenRead( const char *filename, const char *mode = "rb" ); diff --git a/tools/quake3/q3map2/games.cpp b/tools/quake3/q3map2/games.cpp index c1bd70b8..189584bb 100644 --- a/tools/quake3/q3map2/games.cpp +++ b/tools/quake3/q3map2/games.cpp @@ -29,6 +29,7 @@ #include "games.h" #include "bspfile_ibsp.h" #include "bspfile_rbsp.h" +#include "cmdlib.h" struct game_default : game_t { @@ -521,6 +522,7 @@ struct game_ef : game_default homeBasePath = ".ef"; magic = "elite"; /* overwrite "ladder" entry; note: magic number */ + ENSURE( strEqual( surfaceParms[31].name, "ladder" ) ); surfaceParms[31] = { "ladder", E_CONT_LADDER, Q_CONT_SOLID, Q_SURF_LADDER, 0, C_DETAIL | C_TRANSLUCENT, C_SOLID }; surfaceParms.insert( surfaceParms.end(), {