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
This commit is contained in:
Vadim Zeitlin
2006-02-11 16:20:28 +00:00
parent 5ac31f6f8d
commit 34af0de434
3 changed files with 23 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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