X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2478fde622a16d25c66690af353dfdc37e7b582..f1e269209afbcbec4e46ab5df4ba43d902a6bf2f:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index 53de91f046..4da49d8fe9 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "log.h" #endif @@ -33,6 +33,7 @@ // wxWindows #ifndef WX_PRECOMP #include "wx/app.h" + #include "wx/arrstr.h" #include "wx/intl.h" #include "wx/string.h" #endif //WX_PRECOMP @@ -47,9 +48,21 @@ #include "wx/wxchar.h" // other standard headers +#ifndef __WXWINCE__ #include +#endif + #include + +#ifndef __WXWINCE__ #include +#else +#include "wx/msw/wince/time.h" +#endif + +#if defined(__WINDOWS__) + #include "wx/msw/private.h" // includes windows.h +#endif // ---------------------------------------------------------------------------- // non member functions @@ -174,7 +187,11 @@ void wxVLogFatalError(const wxChar *szFormat, va_list argptr) wxSafeShowMessage(_T("Fatal Error"), s_szBuf); +#ifdef __WXWINCE__ + ExitThread(3); +#else abort(); +#endif } void wxLogFatalError(const wxChar *szFormat, ...) @@ -380,7 +397,7 @@ wxLog *wxLog::GetActiveTarget() // ask the application to create a log target for us if ( wxTheApp != NULL ) - ms_pLogger = wxTheApp->CreateLogTarget(); + ms_pLogger = wxTheApp->GetTraits()->CreateLogTarget(); else ms_pLogger = new wxLogStderr; @@ -421,7 +438,7 @@ void wxLog::RemoveTraceMask(const wxString& str) { int index = ms_aTraceMasks.Index(str); if ( index != wxNOT_FOUND ) - ms_aTraceMasks.Remove((size_t)index); + ms_aTraceMasks.RemoveAt((size_t)index); } void wxLog::ClearTraceMasks() @@ -450,7 +467,11 @@ void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t) DoLogString(wxString(_("Fatal error: ")) + szString, t); DoLogString(_("Program aborted."), t); Flush(); +#ifdef __WXWINCE__ + ExitThread(3); +#else abort(); +#endif break; case wxLOG_Error: @@ -493,6 +514,16 @@ void wxLog::Flush() // 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 // ----------------------------------------------------------------------------