X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f98377912b600d6c3b53b3c2587b84ad62b36532..9e1fc0e42822fdf1159582f1b73cde0c7d15bc92:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 50e1457c19..d8cd14dc7a 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -81,13 +81,18 @@ // allows to exclude the usage of wxDateTime static wxString TimeStamp(const wxChar *format, time_t t) { +#if wxUSE_DATETIME wxChar buf[4096]; - if ( !wxStrftime(buf, WXSIZEOF(buf), format, localtime(&t)) ) + struct tm tm; + if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) ) { // buffer is too small? wxFAIL_MSG(_T("strftime() failed")); } return wxString(buf); +#else // !wxUSE_DATETIME + return wxEmptyString; +#endif // wxUSE_DATETIME/!wxUSE_DATETIME }