|
|
@ -135,16 +135,13 @@ void ErrorAssert(int line, const char* file, const char* fmt, ...) |
|
|
|
if (s_GuiAsserts) |
|
|
|
if (s_GuiAsserts) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_CrtDbgReport(_CRT_ASSERT, file, line, NULL, msg)) |
|
|
|
if (_CrtDbgReport(_CRT_ASSERT, file, line, NULL, msg)) |
|
|
|
DebugBreak(); |
|
|
|
DebugBreakAlways(); |
|
|
|
} else |
|
|
|
} else |
|
|
|
#endif // _MSC_VER
|
|
|
|
#endif // _MSC_VER
|
|
|
|
{ |
|
|
|
{ |
|
|
|
char str[] = "-------\nASSERTION FAILED:\nFile: %s Line: %i\nMessage: %s\n-------"; |
|
|
|
char str[] = "-------\nASSERTION FAILED:\nFile: %s Line: %i\nMessage: %s\n-------"; |
|
|
|
DebugMsg(str, file, line, msg); |
|
|
|
DebugMsg(str, file, line, msg); |
|
|
|
DebugBreakIfDebuggerPresent(); |
|
|
|
DebugBreakAlways(); |
|
|
|
|
|
|
|
|
|
|
|
// In case the debug trap is ignored
|
|
|
|
|
|
|
|
abort(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endif // HS_DEBUGGING
|
|
|
|
#endif // HS_DEBUGGING
|
|
|
|
#else |
|
|
|
#else |
|
|
@ -191,8 +188,23 @@ void DebugBreakIfDebuggerPresent() |
|
|
|
// Debugger not present or some such shwiz.
|
|
|
|
// Debugger not present or some such shwiz.
|
|
|
|
// Whatever. Don't crash here.
|
|
|
|
// Whatever. Don't crash here.
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#elif defined(HS_BUILD_FOR_UNIX) |
|
|
|
|
|
|
|
if (DebugIsDebuggerPresent()) |
|
|
|
|
|
|
|
raise(SIGTRAP); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
#endif // _MSC_VER
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DebugBreakAlways() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
#if defined(_MSC_VER) |
|
|
|
|
|
|
|
DebugBreak(); |
|
|
|
#elif defined(HS_BUILD_FOR_UNIX) |
|
|
|
#elif defined(HS_BUILD_FOR_UNIX) |
|
|
|
raise(SIGTRAP); |
|
|
|
raise(SIGTRAP); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
abort(); |
|
|
|
#endif // _MSC_VER
|
|
|
|
#endif // _MSC_VER
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|