mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
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:
parent
f1afb94f6e
commit
12a46dee60
3 changed files with 19 additions and 10 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue