don't redefine HAVE_STRFTIME as it can already be defined by configure (closes #10861)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -139,9 +139,12 @@ extern WXDLLIMPEXP_DATA_BASE(const wxDateTime) wxDefaultDateTime;
|
|||||||
// conditional compilation
|
// conditional compilation
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// everyone has strftime except Win CE unless VC8 is used
|
// if configure detected strftime(), we have it too
|
||||||
#if !defined(__WXWINCE__) || defined(__VISUALC8__)
|
#ifdef HAVE_STRFTIME
|
||||||
#define 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
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -453,7 +453,7 @@ static long GetTruncatedJDN(wxDateTime::wxDateTime_t day,
|
|||||||
- JDN_OFFSET;
|
- JDN_OFFSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef wxHAS_STRFTIME
|
||||||
|
|
||||||
// this function is a wrapper around strftime(3) adding error checking
|
// this function is a wrapper around strftime(3) adding error checking
|
||||||
// NOTE: not static because used by datetimefmt.cpp
|
// NOTE: not static because used by datetimefmt.cpp
|
||||||
@@ -476,7 +476,7 @@ wxString CallStrftime(const wxString& format, const tm* tm)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAVE_STRFTIME
|
#endif // wxHAS_STRFTIME
|
||||||
|
|
||||||
// if year and/or month have invalid values, replace them with the current ones
|
// if year and/or month have invalid values, replace them with the current ones
|
||||||
static void ReplaceDefaultYearMonthWithCurrent(int *year,
|
static void ReplaceDefaultYearMonthWithCurrent(int *year,
|
||||||
@@ -855,7 +855,7 @@ wxString wxDateTime::GetEnglishMonthName(Month month, NameFlags flags)
|
|||||||
wxString wxDateTime::GetMonthName(wxDateTime::Month month,
|
wxString wxDateTime::GetMonthName(wxDateTime::Month month,
|
||||||
wxDateTime::NameFlags flags)
|
wxDateTime::NameFlags flags)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef wxHAS_STRFTIME
|
||||||
wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
|
wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
|
||||||
|
|
||||||
// notice that we must set all the fields to avoid confusing libc (GNU one
|
// notice that we must set all the fields to avoid confusing libc (GNU one
|
||||||
@@ -865,9 +865,9 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month,
|
|||||||
tm.tm_mon = month;
|
tm.tm_mon = month;
|
||||||
|
|
||||||
return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
|
return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
|
||||||
#else // !HAVE_STRFTIME
|
#else // !wxHAS_STRFTIME
|
||||||
return GetEnglishMonthName(month, flags);
|
return GetEnglishMonthName(month, flags);
|
||||||
#endif // HAVE_STRFTIME/!HAVE_STRFTIME
|
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
@@ -893,7 +893,7 @@ wxString wxDateTime::GetEnglishWeekDayName(WeekDay wday, NameFlags flags)
|
|||||||
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
|
wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
|
||||||
wxDateTime::NameFlags flags)
|
wxDateTime::NameFlags flags)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef wxHAS_STRFTIME
|
||||||
wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
|
wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
|
||||||
|
|
||||||
// take some arbitrary Sunday (but notice that the day should be such that
|
// take some arbitrary Sunday (but notice that the day should be such that
|
||||||
@@ -913,9 +913,9 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
|
|||||||
|
|
||||||
// ... and call strftime()
|
// ... and call strftime()
|
||||||
return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
|
return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
|
||||||
#else // !HAVE_STRFTIME
|
#else // !wxHAS_STRFTIME
|
||||||
return GetEnglishWeekDayName(wday, flags);
|
return GetEnglishWeekDayName(wday, flags);
|
||||||
#endif // HAVE_STRFTIME/!HAVE_STRFTIME
|
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
Reference in New Issue
Block a user