1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs)
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "log.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
33 #include "wx/string.h"
38 #include "wx/window.h"
39 #include "wx/msgdlg.h"
41 #include "wx/msw/private.h"
47 #include "wx/textfile.h"
49 #include "wx/wxchar.h"
51 #include "wx/thread.h"
55 // other standard headers
60 #if defined(__WXMSW__)
61 #include "wx/msw/private.h" // includes windows.h for OutputDebugString
64 #if defined(__WXMAC__)
65 #include "wx/mac/private.h" // includes mac headers
68 // ----------------------------------------------------------------------------
69 // non member functions
70 // ----------------------------------------------------------------------------
72 // define this to enable wrapping of log messages
73 //#define LOG_PRETTY_WRAP
75 #ifdef LOG_PRETTY_WRAP
76 static void wxLogWrap(FILE *f
, const char *pszPrefix
, const char *psz
);
79 // ============================================================================
81 // ============================================================================
83 // ----------------------------------------------------------------------------
85 // ----------------------------------------------------------------------------
87 // log functions can't allocate memory (LogError("out of memory...") should
88 // work!), so we use a static buffer for all log messages
89 #define LOG_BUFFER_SIZE (4096)
91 // static buffer for error messages
92 static wxChar s_szBufStatic
[LOG_BUFFER_SIZE
];
94 static wxChar
*s_szBuf
= s_szBufStatic
;
95 static size_t s_szBufSize
= WXSIZEOF( s_szBufStatic
);
99 // the critical section protecting the static buffer
100 static wxCriticalSection gs_csLogBuf
;
102 #endif // wxUSE_THREADS
104 // return true if we have a non NULL non disabled log target
105 static inline bool IsLoggingEnabled()
107 return wxLog::IsEnabled() && (wxLog::GetActiveTarget() != NULL
);
110 // ----------------------------------------------------------------------------
111 // implementation of Log functions
113 // NB: unfortunately we need all these distinct functions, we can't make them
114 // macros and not all compilers inline vararg functions.
115 // ----------------------------------------------------------------------------
117 // generic log function
118 void wxVLogGeneric(wxLogLevel level
, const wxChar
*szFormat
, va_list argptr
)
120 if ( IsLoggingEnabled() ) {
121 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
123 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
125 wxLog::OnLog(level
, s_szBuf
, time(NULL
));
129 void wxLogGeneric(wxLogLevel level
, const wxChar
*szFormat
, ...)
132 va_start(argptr
, szFormat
);
133 wxVLogGeneric(level
, szFormat
, argptr
);
137 #define IMPLEMENT_LOG_FUNCTION(level) \
138 void wxVLog##level(const wxChar *szFormat, va_list argptr) \
140 if ( IsLoggingEnabled() ) { \
141 wxCRIT_SECT_LOCKER(locker, gs_csLogBuf); \
143 wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr); \
145 wxLog::OnLog(wxLOG_##level, s_szBuf, time(NULL)); \
148 void wxLog##level(const wxChar *szFormat, ...) \
151 va_start(argptr, szFormat); \
152 wxVLog##level(szFormat, argptr); \
156 IMPLEMENT_LOG_FUNCTION(Error
)
157 IMPLEMENT_LOG_FUNCTION(Warning
)
158 IMPLEMENT_LOG_FUNCTION(Message
)
159 IMPLEMENT_LOG_FUNCTION(Info
)
160 IMPLEMENT_LOG_FUNCTION(Status
)
162 void wxSafeShowMessage(const wxString
& title
, const wxString
& text
)
165 ::MessageBox(NULL
, text
, title
, MB_OK
| MB_ICONSTOP
);
167 wxFprintf(stderr
, _T("%s: %s\n"), title
.c_str(), text
.c_str());
171 // fatal errors can't be suppressed nor handled by the custom log target and
172 // always terminate the program
173 void wxVLogFatalError(const wxChar
*szFormat
, va_list argptr
)
175 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
177 wxSafeShowMessage(_T("Fatal Error"), s_szBuf
);
182 void wxLogFatalError(const wxChar
*szFormat
, ...)
185 va_start(argptr
, szFormat
);
186 wxVLogFatalError(szFormat
, argptr
);
190 // same as info, but only if 'verbose' mode is on
191 void wxVLogVerbose(const wxChar
*szFormat
, va_list argptr
)
193 if ( IsLoggingEnabled() ) {
194 wxLog
*pLog
= wxLog::GetActiveTarget();
195 if ( pLog
!= NULL
&& pLog
->GetVerbose() ) {
196 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
198 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
200 wxLog::OnLog(wxLOG_Info
, s_szBuf
, time(NULL
));
205 void wxLogVerbose(const wxChar
*szFormat
, ...)
208 va_start(argptr
, szFormat
);
209 wxVLogVerbose(szFormat
, argptr
);
215 #define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
216 void wxVLog##level(const wxChar *szFormat, va_list argptr) \
218 if ( IsLoggingEnabled() ) { \
219 wxCRIT_SECT_LOCKER(locker, gs_csLogBuf); \
221 wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr); \
223 wxLog::OnLog(wxLOG_##level, s_szBuf, time(NULL)); \
226 void wxLog##level(const wxChar *szFormat, ...) \
229 va_start(argptr, szFormat); \
230 wxVLog##level(szFormat, argptr); \
234 void wxVLogTrace(const wxChar
*mask
, const wxChar
*szFormat
, va_list argptr
)
236 if ( IsLoggingEnabled() && wxLog::IsAllowedTraceMask(mask
) ) {
237 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
240 size_t len
= s_szBufSize
;
241 wxStrncpy(s_szBuf
, _T("("), len
);
242 len
-= 1; // strlen("(")
244 wxStrncat(p
, mask
, len
);
245 size_t lenMask
= wxStrlen(mask
);
249 wxStrncat(p
, _T(") "), len
);
253 wxVsnprintf(p
, len
, szFormat
, argptr
);
255 wxLog::OnLog(wxLOG_Trace
, s_szBuf
, time(NULL
));
259 void wxLogTrace(const wxChar
*mask
, const wxChar
*szFormat
, ...)
262 va_start(argptr
, szFormat
);
263 wxVLogTrace(mask
, szFormat
, argptr
);
267 void wxVLogTrace(wxTraceMask mask
, const wxChar
*szFormat
, va_list argptr
)
269 // we check that all of mask bits are set in the current mask, so
270 // that wxLogTrace(wxTraceRefCount | wxTraceOle) will only do something
271 // if both bits are set.
272 if ( IsLoggingEnabled() && ((wxLog::GetTraceMask() & mask
) == mask
) ) {
273 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
275 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
277 wxLog::OnLog(wxLOG_Trace
, s_szBuf
, time(NULL
));
281 void wxLogTrace(wxTraceMask mask
, const wxChar
*szFormat
, ...)
284 va_start(argptr
, szFormat
);
285 wxVLogTrace(mask
, szFormat
, argptr
);
290 #define IMPLEMENT_LOG_DEBUG_FUNCTION(level)
293 IMPLEMENT_LOG_DEBUG_FUNCTION(Debug
)
294 IMPLEMENT_LOG_DEBUG_FUNCTION(Trace
)
296 // wxLogSysError: one uses the last error code, for other you must give it
299 // common part of both wxLogSysError
300 void wxLogSysErrorHelper(long lErrCode
)
302 wxChar szErrMsg
[LOG_BUFFER_SIZE
/ 2];
303 wxSnprintf(szErrMsg
, WXSIZEOF(szErrMsg
),
304 _(" (error %ld: %s)"), lErrCode
, wxSysErrorMsg(lErrCode
));
305 wxStrncat(s_szBuf
, szErrMsg
, s_szBufSize
- wxStrlen(s_szBuf
));
307 wxLog::OnLog(wxLOG_Error
, s_szBuf
, time(NULL
));
310 void WXDLLEXPORT
wxVLogSysError(const wxChar
*szFormat
, va_list argptr
)
312 if ( IsLoggingEnabled() ) {
313 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
315 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
317 wxLogSysErrorHelper(wxSysErrorCode());
321 void WXDLLEXPORT
wxLogSysError(const wxChar
*szFormat
, ...)
324 va_start(argptr
, szFormat
);
325 wxVLogSysError(szFormat
, argptr
);
329 void WXDLLEXPORT
wxVLogSysError(long lErrCode
, const wxChar
*szFormat
, va_list argptr
)
331 if ( IsLoggingEnabled() ) {
332 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
334 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
336 wxLogSysErrorHelper(lErrCode
);
340 void WXDLLEXPORT
wxLogSysError(long lErrCode
, const wxChar
*szFormat
, ...)
343 va_start(argptr
, szFormat
);
344 wxVLogSysError(lErrCode
, szFormat
, argptr
);
348 // ----------------------------------------------------------------------------
349 // wxLog class implementation
350 // ----------------------------------------------------------------------------
354 m_bHasMessages
= FALSE
;
357 wxChar
*wxLog::SetLogBuffer( wxChar
*buf
, size_t size
)
359 wxChar
*oldbuf
= s_szBuf
;
363 s_szBuf
= s_szBufStatic
;
364 s_szBufSize
= WXSIZEOF( s_szBufStatic
);
372 return (oldbuf
== s_szBufStatic
) ? 0 : oldbuf
;
375 wxLog
*wxLog::GetActiveTarget()
377 if ( ms_bAutoCreate
&& ms_pLogger
== NULL
) {
378 // prevent infinite recursion if someone calls wxLogXXX() from
379 // wxApp::CreateLogTarget()
380 static bool s_bInGetActiveTarget
= FALSE
;
381 if ( !s_bInGetActiveTarget
) {
382 s_bInGetActiveTarget
= TRUE
;
384 // ask the application to create a log target for us
385 if ( wxTheApp
!= NULL
)
386 ms_pLogger
= wxTheApp
->CreateLogTarget();
388 ms_pLogger
= new wxLogStderr
;
390 s_bInGetActiveTarget
= FALSE
;
392 // do nothing if it fails - what can we do?
399 wxLog
*wxLog::SetActiveTarget(wxLog
*pLogger
)
401 if ( ms_pLogger
!= NULL
) {
402 // flush the old messages before changing because otherwise they might
403 // get lost later if this target is not restored
407 wxLog
*pOldLogger
= ms_pLogger
;
408 ms_pLogger
= pLogger
;
413 void wxLog::DontCreateOnDemand()
415 ms_bAutoCreate
= FALSE
;
417 // this is usually called at the end of the program and we assume that it
418 // is *always* called at the end - so we free memory here to avoid false
419 // memory leak reports from wxWin memory tracking code
423 void wxLog::RemoveTraceMask(const wxString
& str
)
425 int index
= ms_aTraceMasks
.Index(str
);
426 if ( index
!= wxNOT_FOUND
)
427 ms_aTraceMasks
.Remove((size_t)index
);
430 void wxLog::ClearTraceMasks()
432 ms_aTraceMasks
.Clear();
435 void wxLog::TimeStamp(wxString
*str
)
441 (void)time(&timeNow
);
442 wxStrftime(buf
, WXSIZEOF(buf
), ms_timestamp
, localtime(&timeNow
));
445 *str
<< buf
<< wxT(": ");
449 void wxLog::DoLog(wxLogLevel level
, const wxChar
*szString
, time_t t
)
452 case wxLOG_FatalError
:
453 DoLogString(wxString(_("Fatal error: ")) + szString
, t
);
454 DoLogString(_("Program aborted."), t
);
460 DoLogString(wxString(_("Error: ")) + szString
, t
);
464 DoLogString(wxString(_("Warning: ")) + szString
, t
);
471 default: // log unknown log levels too
472 DoLogString(szString
, t
);
479 wxString msg
= level
== wxLOG_Trace
? wxT("Trace: ")
489 void wxLog::DoLogString(const wxChar
*WXUNUSED(szString
), time_t WXUNUSED(t
))
491 wxFAIL_MSG(wxT("DoLogString must be overriden if it's called."));
496 // remember that we don't have any more messages to show
497 m_bHasMessages
= FALSE
;
500 // ----------------------------------------------------------------------------
501 // wxLogStderr class implementation
502 // ----------------------------------------------------------------------------
504 wxLogStderr::wxLogStderr(FILE *fp
)
512 #if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
514 // MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds...
516 #ifndef __MetroNubUtils__
517 #include "MetroNubUtils.h"
536 #if TARGET_API_MAC_CARBON
538 #include <CodeFragments.h>
541 CallUniversalProc(UniversalProcPtr theProcPtr
, ProcInfoType procInfo
, ...);
543 ProcPtr gCallUniversalProc_Proc
= NULL
;
547 static MetroNubUserEntryBlock
* gMetroNubEntry
= NULL
;
549 static long fRunOnce
= false;
551 Boolean
IsCompatibleVersion(short inVersion
);
553 /* ---------------------------------------------------------------------------
555 --------------------------------------------------------------------------- */
557 Boolean
IsCompatibleVersion(short inVersion
)
559 Boolean result
= false;
563 MetroNubUserEntryBlock
* block
= (MetroNubUserEntryBlock
*)result
;
565 result
= (inVersion
<= block
->apiHiVersion
);
571 /* ---------------------------------------------------------------------------
573 --------------------------------------------------------------------------- */
575 Boolean
IsMetroNubInstalled()
582 gMetroNubEntry
= NULL
;
584 if (Gestalt(gestaltSystemVersion
, &value
) == noErr
&& value
< 0x1000)
586 /* look for MetroNub's Gestalt selector */
587 if (Gestalt(kMetroNubUserSignature
, &result
) == noErr
)
590 #if TARGET_API_MAC_CARBON
591 if (gCallUniversalProc_Proc
== NULL
)
593 CFragConnectionID connectionID
;
596 ProcPtr symbolAddress
;
598 CFragSymbolClass symbolClass
;
600 symbolAddress
= NULL
;
601 err
= GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch
, kFindCFrag
,
602 &connectionID
, &mainAddress
, errorString
);
606 gCallUniversalProc_Proc
= NULL
;
610 err
= FindSymbol(connectionID
, "\pCallUniversalProc",
611 (Ptr
*) &gCallUniversalProc_Proc
, &symbolClass
);
615 gCallUniversalProc_Proc
= NULL
;
622 MetroNubUserEntryBlock
* block
= (MetroNubUserEntryBlock
*)result
;
624 /* make sure the version of the API is compatible */
625 if (block
->apiLowVersion
<= kMetroNubUserAPIVersion
&&
626 kMetroNubUserAPIVersion
<= block
->apiHiVersion
)
627 gMetroNubEntry
= block
; /* success! */
636 #if TARGET_API_MAC_CARBON
637 return (gMetroNubEntry
!= NULL
&& gCallUniversalProc_Proc
!= NULL
);
639 return (gMetroNubEntry
!= NULL
);
643 /* ---------------------------------------------------------------------------
644 IsMWDebuggerRunning [v1 API]
645 --------------------------------------------------------------------------- */
647 Boolean
IsMWDebuggerRunning()
649 if (IsMetroNubInstalled())
650 return CallIsDebuggerRunningProc(gMetroNubEntry
->isDebuggerRunning
);
655 /* ---------------------------------------------------------------------------
656 AmIBeingMWDebugged [v1 API]
657 --------------------------------------------------------------------------- */
659 Boolean
AmIBeingMWDebugged()
661 if (IsMetroNubInstalled())
662 return CallAmIBeingDebuggedProc(gMetroNubEntry
->amIBeingDebugged
);
667 /* ---------------------------------------------------------------------------
668 UserSetWatchPoint [v2 API]
669 --------------------------------------------------------------------------- */
671 OSErr
UserSetWatchPoint (Ptr address
, long length
, WatchPointIDT
* watchPointID
)
673 if (IsMetroNubInstalled() && IsCompatibleVersion(kMetroNubUserAPIVersion
))
674 return CallUserSetWatchPointProc(gMetroNubEntry
->userSetWatchPoint
,
675 address
, length
, watchPointID
);
677 return errProcessIsNotClient
;
680 /* ---------------------------------------------------------------------------
681 ClearWatchPoint [v2 API]
682 --------------------------------------------------------------------------- */
684 OSErr
ClearWatchPoint (WatchPointIDT watchPointID
)
686 if (IsMetroNubInstalled() && IsCompatibleVersion(kMetroNubUserAPIVersion
))
687 return CallClearWatchPointProc(gMetroNubEntry
->clearWatchPoint
, watchPointID
);
689 return errProcessIsNotClient
;
696 #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)
698 void wxLogStderr::DoLogString(const wxChar
*szString
, time_t WXUNUSED(t
))
704 fputs(str
.mb_str(), m_fp
);
705 fputc(_T('\n'), m_fp
);
708 // under Windows, programs usually don't have stderr at all, so show the
709 // messages also under debugger - unless it's a console program
710 #if defined(__WXMSW__) && wxUSE_GUI && !defined(__WXMICROWIN__)
712 OutputDebugString(str
.c_str());
714 #if defined(__WXMAC__) && !defined(__DARWIN__) && wxUSE_GUI
716 strcpy( (char*) pstr
, str
.c_str() ) ;
717 strcat( (char*) pstr
, ";g" ) ;
718 c2pstr( (char*) pstr
) ;
720 Boolean running
= false ;
722 #if defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
724 if ( IsMWDebuggerRunning() && AmIBeingMWDebugged() )
742 // ----------------------------------------------------------------------------
743 // wxLogStream implementation
744 // ----------------------------------------------------------------------------
746 #if wxUSE_STD_IOSTREAM
747 wxLogStream::wxLogStream(wxSTD ostream
*ostr
)
750 m_ostr
= &wxSTD cerr
;
755 void wxLogStream::DoLogString(const wxChar
*szString
, time_t WXUNUSED(t
))
759 (*m_ostr
) << str
<< wxConvertWX2MB(szString
) << wxSTD endl
;
761 #endif // wxUSE_STD_IOSTREAM
763 // ----------------------------------------------------------------------------
765 // ----------------------------------------------------------------------------
767 wxLogChain::wxLogChain(wxLog
*logger
)
769 m_bPassMessages
= TRUE
;
772 m_logOld
= wxLog::SetActiveTarget(this);
775 wxLogChain::~wxLogChain()
779 if ( m_logNew
!= this )
783 void wxLogChain::SetLog(wxLog
*logger
)
785 if ( m_logNew
!= this )
791 void wxLogChain::Flush()
796 // be careful to avoid inifinite recursion
797 if ( m_logNew
&& m_logNew
!= this )
801 void wxLogChain::DoLog(wxLogLevel level
, const wxChar
*szString
, time_t t
)
803 // let the previous logger show it
804 if ( m_logOld
&& IsPassingMessages() )
806 // bogus cast just to access protected DoLog
807 ((wxLogChain
*)m_logOld
)->DoLog(level
, szString
, t
);
810 if ( m_logNew
&& m_logNew
!= this )
813 ((wxLogChain
*)m_logNew
)->DoLog(level
, szString
, t
);
817 // ----------------------------------------------------------------------------
819 // ----------------------------------------------------------------------------
822 // "'this' : used in base member initializer list" - so what?
823 #pragma warning(disable:4355)
826 wxLogPassThrough::wxLogPassThrough()
832 #pragma warning(default:4355)
835 // ============================================================================
836 // Global functions/variables
837 // ============================================================================
839 // ----------------------------------------------------------------------------
841 // ----------------------------------------------------------------------------
843 wxLog
*wxLog::ms_pLogger
= (wxLog
*)NULL
;
844 bool wxLog::ms_doLog
= TRUE
;
845 bool wxLog::ms_bAutoCreate
= TRUE
;
846 bool wxLog::ms_bVerbose
= FALSE
;
848 wxLogLevel
wxLog::ms_logLevel
= wxLOG_Max
; // log everything by default
850 size_t wxLog::ms_suspendCount
= 0;
853 const wxChar
*wxLog::ms_timestamp
= wxT("%X"); // time only, no date
855 const wxChar
*wxLog::ms_timestamp
= NULL
; // save space
858 wxTraceMask
wxLog::ms_ulTraceMask
= (wxTraceMask
)0;
859 wxArrayString
wxLog::ms_aTraceMasks
;
861 // ----------------------------------------------------------------------------
862 // stdout error logging helper
863 // ----------------------------------------------------------------------------
865 // helper function: wraps the message and justifies it under given position
866 // (looks more pretty on the terminal). Also adds newline at the end.
868 // TODO this is now disabled until I find a portable way of determining the
869 // terminal window size (ok, I found it but does anybody really cares?)
870 #ifdef LOG_PRETTY_WRAP
871 static void wxLogWrap(FILE *f
, const char *pszPrefix
, const char *psz
)
873 size_t nMax
= 80; // FIXME
874 size_t nStart
= strlen(pszPrefix
);
878 while ( *psz
!= '\0' ) {
879 for ( n
= nStart
; (n
< nMax
) && (*psz
!= '\0'); n
++ )
883 if ( *psz
!= '\0' ) {
885 for ( n
= 0; n
< nStart
; n
++ )
888 // as we wrapped, squeeze all white space
889 while ( isspace(*psz
) )
896 #endif //LOG_PRETTY_WRAP
898 // ----------------------------------------------------------------------------
899 // error code/error message retrieval functions
900 // ----------------------------------------------------------------------------
902 // get error code from syste
903 unsigned long wxSysErrorCode()
905 #if defined(__WXMSW__) && !defined(__WXMICROWIN__)
907 return ::GetLastError();
909 // TODO what to do on Windows 3.1?
917 // get error message from system
918 const wxChar
*wxSysErrorMsg(unsigned long nErrCode
)
921 nErrCode
= wxSysErrorCode();
923 #if defined(__WXMSW__) && !defined(__WXMICROWIN__)
925 static wxChar s_szBuf
[LOG_BUFFER_SIZE
/ 2];
927 // get error message from system
929 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
,
931 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
),
935 // copy it to our buffer and free memory
936 if( lpMsgBuf
!= 0 ) {
937 wxStrncpy(s_szBuf
, (const wxChar
*)lpMsgBuf
, WXSIZEOF(s_szBuf
) - 1);
938 s_szBuf
[WXSIZEOF(s_szBuf
) - 1] = wxT('\0');
942 // returned string is capitalized and ended with '\r\n' - bad
943 s_szBuf
[0] = (wxChar
)wxTolower(s_szBuf
[0]);
944 size_t len
= wxStrlen(s_szBuf
);
947 if ( s_szBuf
[len
- 2] == wxT('\r') )
948 s_szBuf
[len
- 2] = wxT('\0');
952 s_szBuf
[0] = wxT('\0');
962 static wxChar s_szBuf
[LOG_BUFFER_SIZE
/ 2];
963 wxConvCurrent
->MB2WC(s_szBuf
, strerror(nErrCode
), WXSIZEOF(s_szBuf
) -1);
966 return strerror((int)nErrCode
);