- 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 */
// assert, even though it is a perfectly legal use.
if ( am )
{
- if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0)
+ if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0)
*am = wxString(buffer);
else
*am = wxString();
if ( pm )
{
tm.tm_hour = 13;
- if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0)
+ if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0)
*pm = wxString(buffer);
else
*pm = wxString();