//note to self: do try not to rely on this too much. void __cdecl CrashError(const TCHAR *format, ...) { if(!format) return; va_list arglist; va_start(arglist, format); String strOut = FormattedStringva(format, arglist); OpenLogFile(); LogFile.WriteStr(TEXT("\r\nError: ")); LogFile.WriteAsUTF8(strOut); LogFile.WriteStr(TEXT("\r\n")); CloseLogFile(); OSMessageBoxva(format, arglist); #if defined(_DEBUG) && defined(_WIN32) if(bDebugBreak && OSDebuggerPresent()) ProgramBreak(); #endif CriticalExit(); }
void __cdecl OSMessageBox(const TCHAR *format, ...) { va_list arglist; va_start(arglist, format); OSMessageBoxva(format, arglist); }
__declspec(noreturn) void __cdecl DumpError(const TCHAR *format, ...) { va_list arglist; va_start(arglist, format); String strOut(L"\r\nError: "); strOut << FormattedStringva(format, arglist); OpenLogFile(); LogFile.WriteAsUTF8(strOut); LogFile.WriteStr(TEXT("\r\n")); CloseLogFile(); OSMessageBoxva(format, arglist); OSRaiseException(0xDEAD0B5); }