]> git.saurik.com Git - wxWidgets.git/commitdiff
include wx/datetime.h and test for wxUSE_DATETIME before using wxLocaltime_r()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Nov 2006 23:46:02 +0000 (23:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Nov 2006 23:46:02 +0000 (23:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43078 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/log.cpp
src/generic/logg.cpp

index b24d5dc538aec711bb2588e2e90d0c463ec45fb3..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"
@@ -411,6 +412,7 @@ void wxLog::ClearTraceMasks()
 
 void wxLog::TimeStamp(wxString *str)
 {
+#if wxUSE_DATETIME
     if ( ms_timestamp )
     {
         wxChar buf[256];
@@ -424,6 +426,7 @@ void wxLog::TimeStamp(wxString *str)
         str->Empty();
         *str << buf << wxT(": ");
     }
+#endif // wxUSE_DATETIME
 }
 
 void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
index ba6dd538f54467a45167ef9ab9b16986962e8e2e..d8cd14dc7a3da97276b63e9cd8add5e205ced2f9 100644 (file)
@@ -81,6 +81,7 @@
 // allows to exclude the usage of wxDateTime
 static wxString TimeStamp(const wxChar *format, time_t t)
 {
+#if wxUSE_DATETIME
     wxChar buf[4096];
     struct tm tm;
     if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) )
@@ -89,6 +90,9 @@ static wxString TimeStamp(const wxChar *format, time_t t)
         wxFAIL_MSG(_T("strftime() failed"));
     }
     return wxString(buf);
+#else // !wxUSE_DATETIME
+    return wxEmptyString;
+#endif // wxUSE_DATETIME/!wxUSE_DATETIME
 }