Add assert command to test whether assertions are enabled at runtime

This commit is contained in:
James R 2023-02-14 04:10:58 -08:00
parent a77234233b
commit 2e3ed95338

View file

@ -1196,6 +1196,15 @@ const char *D_GetFancyBranchName(void)
return compbranch;
}
static void Command_assert(void)
{
#if !defined(NDEBUG) || defined(PARANOIA)
CONS_Printf("Yes, assertions are enabled.\n");
#else
CONS_Printf("No, ssertions are NOT enabled.\n");
#endif
}
//
// D_SRB2Main
//
@ -1387,6 +1396,8 @@ void D_SRB2Main(void)
// Do this up here so that WADs loaded through the command line can use ExecCfg
COM_Init();
COM_AddCommand("assert", Command_assert);
#ifndef TESTERS
// add any files specified on the command line with -file wadfile
// to the wad list