// 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
// ----------------------------------------------------------------------------
- JDN_OFFSET;
}
-#ifdef HAVE_STRFTIME
+#ifdef wxHAS_STRFTIME
// this function is a wrapper around strftime(3) adding error checking
// NOTE: not static because used by datetimefmt.cpp
return s;
}
-#endif // HAVE_STRFTIME
+#endif // wxHAS_STRFTIME
// 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)
{
-#ifdef HAVE_STRFTIME
+#ifdef wxHAS_STRFTIME
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);
-#else // !HAVE_STRFTIME
+#else // !wxHAS_STRFTIME
return GetEnglishMonthName(month, flags);
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
}
/* static */
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
wxDateTime::NameFlags flags)
{
-#ifdef HAVE_STRFTIME
+#ifdef wxHAS_STRFTIME
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);
-#else // !HAVE_STRFTIME
+#else // !wxHAS_STRFTIME
return GetEnglishWeekDayName(wday, flags);
-#endif // HAVE_STRFTIME/!HAVE_STRFTIME
+#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
}
/* static */