diff --git a/src/common/log.cpp b/src/common/log.cpp index 837956d26a..e7669a12e9 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -750,20 +750,9 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg) // developpers only wxStrcat(szBuf, wxT("\nDo you want to stop the program?\nYou can also choose [Cancel] to suppress further warnings.")); -#if wxUSE_GUI - switch ( wxMessageBox(szBuf, wxT("Debug"), - wxYES_NO | wxCANCEL | wxICON_STOP ) ) { - case wxYES: - Trap(); - break; - - case wxCANCEL: - s_bNoAsserts = TRUE; - break; - - //case wxNO: nothing to do - } -#else // !GUI, but MSW + // use the native message box if available: this is more robust than + // using our own +#ifdef __WXMSW__ switch ( ::MessageBox(NULL, szBuf, _T("Debug"), MB_YESNOCANCEL | MB_ICONSTOP ) ) { case IDYES: @@ -776,6 +765,19 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg) //case IDNO: nothing to do } +#else // !MSW + switch ( wxMessageBox(szBuf, wxT("Debug"), + wxYES_NO | wxCANCEL | wxICON_STOP ) ) { + case wxYES: + Trap(); + break; + + case wxCANCEL: + s_bNoAsserts = TRUE; + break; + + //case wxNO: nothing to do + } #endif // GUI or MSW #else // !GUI