]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
rebaked after addition of XRC handler for richtext control
[wxWidgets.git] / src / common / log.cpp
index affdec61cbe638c8ed7971dd2eb9c03c4593a3f5..c59af3cb3ff40461df363cfdb0b5f75ed4b365e4 100644 (file)
@@ -37,6 +37,7 @@
 #endif //WX_PRECOMP
 
 #include "wx/apptrait.h"
+#include "wx/datetime.h"
 #include "wx/file.h"
 #include "wx/msgout.h"
 #include "wx/textfile.h"
@@ -340,11 +341,15 @@ void wxLog::OnLog(wxLogLevel level, const wxChar *szString, time_t t)
 }
 
 // deprecated function
+#if WXWIN_COMPATIBILITY_2_6
+
 wxChar *wxLog::SetLogBuffer(wxChar * WXUNUSED(buf), size_t WXUNUSED(size))
 {
     return NULL;
 }
 
+#endif // WXWIN_COMPATIBILITY_2_6
+
 wxLog *wxLog::GetActiveTarget()
 {
     if ( ms_bAutoCreate && ms_pLogger == NULL ) {
@@ -407,16 +412,21 @@ void wxLog::ClearTraceMasks()
 
 void wxLog::TimeStamp(wxString *str)
 {
+#if wxUSE_DATETIME
     if ( ms_timestamp )
     {
         wxChar buf[256];
         time_t timeNow;
         (void)time(&timeNow);
-        wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow));
+
+        struct tm tm;
+        wxStrftime(buf, WXSIZEOF(buf),
+                    ms_timestamp, wxLocaltime_r(&timeNow, &tm));
 
         str->Empty();
         *str << buf << wxT(": ");
     }
+#endif // wxUSE_DATETIME
 }
 
 void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)