git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60842
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// conditional compilation
// ----------------------------------------------------------------------------
// conditional compilation
// ----------------------------------------------------------------------------
-// everyone has strftime except Win CE unless VC8 is used
-#if !defined(__WXWINCE__) || defined(__VISUALC8__)
- #define HAVE_STRFTIME
+// if configure detected strftime(), we have it too
+#ifdef HAVE_STRFTIME
+ #define wxHAS_STRFTIME
+// suppose everyone else has strftime except Win CE unless VC8 is used
+#elif !defined(__WXWINCE__) || defined(__VISUALC8__)
+ #define wxHAS_STRFTIME
#endif
// ----------------------------------------------------------------------------
#endif
// ----------------------------------------------------------------------------
// this function is a wrapper around strftime(3) adding error checking
// NOTE: not static because used by datetimefmt.cpp
// this function is a wrapper around strftime(3) adding error checking
// NOTE: not static because used by datetimefmt.cpp
+#endif // wxHAS_STRFTIME
// if year and/or month have invalid values, replace them with the current ones
static void ReplaceDefaultYearMonthWithCurrent(int *year,
// if year and/or month have invalid values, replace them with the current ones
static void ReplaceDefaultYearMonthWithCurrent(int *year,
wxString wxDateTime::GetMonthName(wxDateTime::Month month,
wxDateTime::NameFlags flags)
{
wxString wxDateTime::GetMonthName(wxDateTime::Month month,
wxDateTime::NameFlags flags)
{
wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
// notice that we must set all the fields to avoid confusing libc (GNU one
wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
// notice that we must set all the fields to avoid confusing libc (GNU one
tm.tm_mon = month;
return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
tm.tm_mon = month;
return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
+#else // !wxHAS_STRFTIME
return GetEnglishMonthName(month, flags);
return GetEnglishMonthName(month, flags);
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
wxDateTime::NameFlags flags)
{
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
wxDateTime::NameFlags flags)
{
wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
// take some arbitrary Sunday (but notice that the day should be such that
wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
// take some arbitrary Sunday (but notice that the day should be such that
// ... and call strftime()
return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
// ... and call strftime()
return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
+#else // !wxHAS_STRFTIME
return GetEnglishWeekDayName(wday, flags);
return GetEnglishWeekDayName(wday, flags);
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME