Use __builtin_trap() for assertions on GCC and derivates

This commit is contained in:
dhewg 2011-12-11 11:48:51 +01:00
parent 1d7d57d1f5
commit bc07d06307

View file

@ -580,9 +580,9 @@ void AssertFailed( const char *file, int line, const char *expression ) {
idLib::sys->DebugPrintf( "\n\nASSERTION FAILED!\n%s(%d): '%s'\n", file, line, expression );
#ifdef _WIN32
__asm int 0x03
#elif defined( __linux__ )
__asm__ __volatile__ ("int $0x03");
#elif defined( MACOS_X )
kill( getpid(), SIGINT );
#elif defined( __GNUC__ )
__builtin_trap();
#else
#error dont know how to crash :P
#endif
}