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
This commit is contained in:
Vadim Zeitlin
2006-11-04 23:46:02 +00:00
parent bb7afa499a
commit 7b2d1c74fe
2 changed files with 7 additions and 0 deletions

View 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
}