From: Vadim Zeitlin Date: Sat, 11 Feb 2006 16:20:28 +0000 (+0000) Subject: compilation fixes for wxUSE_DATETIME==0 (another part of patch 1203970) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/34af0de434db039e927805e3dd13fee74979c4e9?hp=5ac31f6f8d0b0bf500ad05b826798cefc9b70945 compilation fixes for wxUSE_DATETIME==0 (another part of patch 1203970) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/debugrpt.cpp b/src/common/debugrpt.cpp index b52f6780b3..2391849334 100644 --- a/src/common/debugrpt.cpp +++ b/src/common/debugrpt.cpp @@ -190,10 +190,16 @@ wxDebugReport::wxDebugReport() // of course, this doesn't protect us against malicious users... wxFileName fn; fn.AssignTempFileName(appname); +#if wxUSE_DATETIME m_dir.Printf(_T("%s%c%s_dbgrpt-%lu-%s"), fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(), wxGetProcessId(), wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str()); +#else + m_dir.Printf(_T("%s%c%s_dbgrpt-%lu"), + fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(), + wxGetProcessId()); +#endif // as we are going to save the process state there use restrictive // permissions diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index ac70cff460..569ca71aac 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -411,7 +411,11 @@ bool wxXmlResource::UpdateResources() { # if wxUSE_FILESYSTEM file = fsys.OpenFile(m_data[i].File); +# if wxUSE_DATETIME modif = file && file->GetModificationTime() > m_data[i].Time; +# else // wxUSE_DATETIME + modif = true; +# endif // wxUSE_DATETIME if (!file) { wxLogError(_("Cannot open file '%s'."), m_data[i].File.c_str()); @@ -419,9 +423,13 @@ bool wxXmlResource::UpdateResources() } wxDELETE(file); wxUnusedVar(file); -# else +# else // wxUSE_FILESYSTEM +# if wxUSE_DATETIME modif = wxDateTime(wxFileModificationTime(m_data[i].File)) > m_data[i].Time; -# endif +# else // wxUSE_DATETIME + modif = true; +# endif // wxUSE_DATETIME +# endif // wxUSE_FILESYSTEM } if (modif) @@ -477,11 +485,13 @@ bool wxXmlResource::UpdateResources() } ProcessPlatformProperty(m_data[i].Doc->GetRoot()); +#if wxUSE_DATETIME #if wxUSE_FILESYSTEM m_data[i].Time = file->GetModificationTime(); -#else +#else // wxUSE_FILESYSTEM m_data[i].Time = wxDateTime(wxFileModificationTime(m_data[i].File)); -#endif +#endif // wxUSE_FILESYSTEM +#endif // wxUSE_DATETIME } # if wxUSE_FILESYSTEM diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index 145ba064d2..2797fa41ac 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -27,6 +27,8 @@ // the macro below to do it //#define CHANGE_SYSTEM_DATE +#if wxUSE_DATETIME + #ifndef __WINDOWS__ #undef CHANGE_SYSTEM_DATE #endif @@ -823,3 +825,4 @@ void DateTimeTestCase::TestDSTBug() #endif // CHANGE_SYSTEM_DATE } +#endif // wxUSE_DATETIME