- if ( s_szBuf[len - 2] == '\r' )
- s_szBuf[len - 2] = '\0';
- }
-
- return s_szBuf;
- #else //Win16
- // TODO @@@@
- return NULL;
- #endif // Win16/32
- #else // Unix
- return strerror(nErrCode);
- #endif // Win/Unix
-}
-
-// ----------------------------------------------------------------------------
-// debug helper
-// ----------------------------------------------------------------------------
-
-#ifdef __DEBUG__
-
-// this function is called when an assert fails
-void wxOnAssert(const char *szFile, int nLine, const char *szMsg)
-{
- // this variable can be set to true to suppress "assert failure" messages
- static s_bNoAsserts = FALSE;
-
- char szBuf[LOG_BUFFER_SIZE];
- sprintf(szBuf, _("Assert failed in file %s at line %d"), szFile, nLine);
- if ( szMsg != NULL ) {
- strcat(szBuf, ": ");
- strcat(szBuf, szMsg);
- }
- else {
- strcat(szBuf, ".");
- }
-
- // send it to the normal log destination
- wxLogDebug(szBuf);
-
- #ifdef __WINDOWS__
- if ( !s_bNoAsserts ) {
- strcat(szBuf, _("\nDo you want to stop the program?"
- "\nYou can also choose [Cancel] to suppress "
- "further warnings."));
-
- switch ( ::MessageBox(NULL, szBuf, _("Debug"),
- MB_YESNOCANCEL | MB_ICONINFORMATION) ) {
- case IDYES:
- DebugBreak();
- break;
-
- case IDCANCEL:
- s_bNoAsserts = TRUE;
- break;
- }