Create FailWithMessage/AssertWithMessage

Migrate some very frequently called macros from global.h to global.cpp. This reduces Windows release executable size by 43 KB.

After moving ASSERT_M and FAIL_M into void functions, these two virtuals in RageFileBasic.h won't compile as they don't return a value. This changes them to return a default value.
This commit is contained in:
sukibaby
2024-10-08 20:52:25 -07:00
committed by teejusb
parent 59e6e94cf3
commit fbe0e0b658
3 changed files with 35 additions and 8 deletions
+13
View File
@@ -25,6 +25,19 @@
#include "archutils/Unix/CrashHandler.h"
#endif
void FailWithMessage(const char* message)
{
CHECKPOINT_M(message);
sm_crash(message);
}
void AssertWithMessage(bool condition, const char* message)
{
if (unlikely(!condition)) {
FailWithMessage(message);
}
}
void sm_crash( const char *reason )
{
#if ( defined(_WIN32) && defined(CRASH_HANDLER) ) || defined(MACOSX) || defined(_XDBG)