Files
itgmania212121/stepmania/src/global.cpp
T

32 lines
769 B
C++
Raw Normal View History

2003-02-16 03:56:52 +00:00
#include "global.h"
2004-03-19 07:32:06 +00:00
#if defined(_WINDOWS)
2004-02-25 01:35:19 +00:00
#include "windows.h"
2004-03-26 02:55:13 +00:00
void NORETURN sm_crash( const char *reason )
2004-02-25 01:35:19 +00:00
{
// throws an exception that gets caught by the exception handler
DebugBreak();
/* Do something after calling DebugBreak, so the call/return isn't optimized
* to a jmp; that way, this function will appear in backtrace stack traces. */
_asm nop;
}
2004-03-19 07:32:06 +00:00
#elif defined(LINUX) || defined(DARWIN)
#include "archutils/Unix/CrashHandler.h"
2004-03-20 09:26:54 +00:00
#include <unistd.h>
2004-03-26 02:55:13 +00:00
void NORETURN sm_crash( const char *reason )
2004-03-19 07:32:06 +00:00
{
2004-03-26 02:55:13 +00:00
ForceCrashHandler( reason );
2004-03-19 07:32:06 +00:00
_exit( 1 );
}
2004-02-25 01:35:19 +00:00
#else
2004-03-26 02:55:13 +00:00
void NORETURN sm_crash( const char *reason )
2004-02-25 01:35:19 +00:00
{
*(char*)0=0;
/* This isn't actually reached. We just do this to convince the compiler that the
* function really doesn't return. */
while(1);
}
#endif