InstallPanicMessageBox support added to Windows: console applications no longer pop up a MessageBox when panicking, instead they write the panic string on the error output and terminate.

git-svn-id: svn://ultimatepp.org/upp/trunk@1664 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
rylek 2009-10-26 23:19:34 +00:00
commit 12a46dee60
3 changed files with 19 additions and 10 deletions

View file

@ -19,18 +19,12 @@ void InstallPanicMessageBox(void (*mb)(const char *title, const char *text))
void PanicMessageBox(const char *title, const char *text)
{
#ifdef PLATFORM_WIN32
# ifdef PLATFORM_WINCE
MessageBox(::GetActiveWindow(), ToSysChrSet(text), ToSysChrSet(title), MB_ICONSTOP | MB_OK | MB_APPLMODAL);
# else
MessageBox(::GetActiveWindow(), text, title, MB_ICONSTOP | MB_OK | MB_APPLMODAL);
# endif
#else
if(sPanicMessageBox)
(*sPanicMessageBox)(title, text);
write(2, text, strlen(text));
write(2, "\n", 1);
#endif
else {
write(2, text, strlen(text));
write(2, "\n", 1);
}
}
void Panic(const char *msg)