use _get_timezone() under VC8 as _timezone is not available in all CRT versions (#4691)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -169,37 +169,18 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter<wxDateTime> , wxFromStringCon
|
|||||||
#define WX_TIMEZONE wxGetTimeZone()
|
#define WX_TIMEZONE wxGetTimeZone()
|
||||||
#elif defined(__DARWIN__)
|
#elif defined(__DARWIN__)
|
||||||
#define WX_GMTOFF_IN_TM
|
#define WX_GMTOFF_IN_TM
|
||||||
#elif defined(__WXWINCE__) && defined(__VISUALC8__)
|
#elif defined(__VISUALC8__)
|
||||||
// _timezone is not present in dynamic run-time library
|
// _timezone is not present in VC8 static run-time library but
|
||||||
#if 0
|
// _get_timezone() is
|
||||||
// Solution (1): use the function equivalent of _timezone
|
|
||||||
static long wxGetTimeZone()
|
static long wxGetTimeZone()
|
||||||
{
|
{
|
||||||
static long s_Timezone = MAXLONG; // invalid timezone
|
static int s_timezone = INT_MAX; // invalid timezone
|
||||||
if (s_Timezone == MAXLONG)
|
if ( s_timezone == INT_MAX )
|
||||||
{
|
_get_timezone(&s_timezone);
|
||||||
int t;
|
|
||||||
_get_timezone(& t);
|
return s_timezone;
|
||||||
s_Timezone = (long) t;
|
|
||||||
}
|
|
||||||
return s_Timezone;
|
|
||||||
}
|
}
|
||||||
#define WX_TIMEZONE wxGetTimeZone()
|
#define WX_TIMEZONE wxGetTimeZone()
|
||||||
#elif 1
|
|
||||||
// Solution (2): using GetTimeZoneInformation
|
|
||||||
static long wxGetTimeZone()
|
|
||||||
{
|
|
||||||
static long timezone = MAXLONG; // invalid timezone
|
|
||||||
if (timezone == MAXLONG)
|
|
||||||
{
|
|
||||||
TIME_ZONE_INFORMATION tzi;
|
|
||||||
::GetTimeZoneInformation(&tzi);
|
|
||||||
timezone = tzi.Bias;
|
|
||||||
}
|
|
||||||
return timezone;
|
|
||||||
}
|
|
||||||
#define WX_TIMEZONE wxGetTimeZone()
|
|
||||||
#endif
|
|
||||||
#else // unknown platform - try timezone
|
#else // unknown platform - try timezone
|
||||||
#define WX_TIMEZONE timezone
|
#define WX_TIMEZONE timezone
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user