From 7b2d1c74fe9778f360b09b3171525c93391df9ce Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 4 Nov 2006 23:46:02 +0000 Subject: [PATCH] include wx/datetime.h and test for wxUSE_DATETIME before using wxLocaltime_r() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43078 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/log.cpp | 3 +++ src/generic/logg.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/common/log.cpp b/src/common/log.cpp index b24d5dc538..c59af3cb3f 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -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) diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index ba6dd538f5..d8cd14dc7a 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -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 }