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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user