// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "log.h"
#endif
// wxWindows
#ifndef WX_PRECOMP
#include "wx/app.h"
+ #include "wx/arrstr.h"
#include "wx/intl.h"
#include "wx/string.h"
#endif //WX_PRECOMP
#include "wx/wxchar.h"
// other standard headers
+#ifndef __WXWINCE__
#include <errno.h>
+#endif
+
#include <stdlib.h>
+
+#ifndef __WXWINCE__
#include <time.h>
+#else
+#include "wx/msw/wince/time.h"
+#endif
#if defined(__WINDOWS__)
#include "wx/msw/private.h" // includes windows.h
wxSafeShowMessage(_T("Fatal Error"), s_szBuf);
+#ifdef __WXWINCE__
+ ExitThread(3);
+#else
abort();
+#endif
}
void wxLogFatalError(const wxChar *szFormat, ...)
DoLogString(wxString(_("Fatal error: ")) + szString, t);
DoLogString(_("Program aborted."), t);
Flush();
+#ifdef __WXWINCE__
+ ExitThread(3);
+#else
abort();
+#endif
break;
case wxLOG_Error:
// nothing to do here
}
+/*static*/ bool wxLog::IsAllowedTraceMask(const wxChar *mask)
+{
+ for ( wxArrayString::iterator it = ms_aTraceMasks.begin(),
+ en = ms_aTraceMasks.end();
+ it != en; ++it )
+ if ( *it == mask)
+ return true;
+ return false;
+}
+
// ----------------------------------------------------------------------------
// wxLogStderr class implementation
// ----------------------------------------------------------------------------
unsigned long wxSysErrorCode()
{
#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
-#ifdef __WIN32__
return ::GetLastError();
-#else //WIN16
- // TODO what to do on Windows 3.1?
- return 0;
-#endif //WIN16/32
#else //Unix
return errno;
#endif //Win/Unix
nErrCode = wxSysErrorCode();
#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
-#ifdef __WIN32__
static wxChar s_szBuf[LOG_BUFFER_SIZE / 2];
// get error message from system
}
return s_szBuf;
-#else //Win16
- // TODO
- return NULL;
-#endif // Win16/32
-#else // Unix
+#else // Unix-WXMICROWIN
#if wxUSE_UNICODE
static wxChar s_szBuf[LOG_BUFFER_SIZE / 2];
wxConvCurrent->MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
#else
return strerror((int)nErrCode);
#endif
-#endif // Win/Unix
+#endif // Win/Unix-WXMICROWIN
}
#endif // wxUSE_LOG