64-bit compile fixes, cleanup and use GetTimeZoneInformation for Windows compilers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -147,40 +147,26 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter<wxDateTime> , wxFromStringCon
|
|||||||
#if !defined(WX_TIMEZONE) && !defined(WX_GMTOFF_IN_TM)
|
#if !defined(WX_TIMEZONE) && !defined(WX_GMTOFF_IN_TM)
|
||||||
#if defined(__WXPALMOS__)
|
#if defined(__WXPALMOS__)
|
||||||
#define WX_GMTOFF_IN_TM
|
#define WX_GMTOFF_IN_TM
|
||||||
#elif defined(__BORLANDC__) || defined(__MINGW32__) || defined(__VISAGECPP__)
|
#elif defined(__WXMSW__)
|
||||||
|
static long wxGetTimeZone()
|
||||||
|
{
|
||||||
|
static long s_timezone = MAXLONG; // invalid timezone
|
||||||
|
if (s_timezone == MAXLONG)
|
||||||
|
{
|
||||||
|
TIME_ZONE_INFORMATION info;
|
||||||
|
GetTimeZoneInformation(&info);
|
||||||
|
s_timezone = info.Bias * 60; // convert minutes to seconds
|
||||||
|
}
|
||||||
|
return s_timezone;
|
||||||
|
}
|
||||||
|
#define WX_TIMEZONE wxGetTimeZone()
|
||||||
|
#elif defined(__VISAGECPP__)
|
||||||
#define WX_TIMEZONE _timezone
|
#define WX_TIMEZONE _timezone
|
||||||
#elif defined(__MWERKS__)
|
#elif defined(__MWERKS__)
|
||||||
long wxmw_timezone = 28800;
|
long wxmw_timezone = 28800;
|
||||||
#define WX_TIMEZONE wxmw_timezone
|
#define WX_TIMEZONE wxmw_timezone
|
||||||
#elif defined(__DJGPP__) || defined(__WINE__)
|
|
||||||
#include <sys/timeb.h>
|
|
||||||
#include <values.h>
|
|
||||||
static long wxGetTimeZone()
|
|
||||||
{
|
|
||||||
static long timezone = MAXLONG; // invalid timezone
|
|
||||||
if (timezone == MAXLONG)
|
|
||||||
{
|
|
||||||
struct timeb tb;
|
|
||||||
ftime(&tb);
|
|
||||||
timezone = tb.timezone;
|
|
||||||
}
|
|
||||||
return timezone;
|
|
||||||
}
|
|
||||||
#define WX_TIMEZONE wxGetTimeZone()
|
|
||||||
#elif defined(__DARWIN__)
|
#elif defined(__DARWIN__)
|
||||||
#define WX_GMTOFF_IN_TM
|
#define WX_GMTOFF_IN_TM
|
||||||
#elif defined(__VISUALC8__)
|
|
||||||
// _timezone is not present in VC8 static run-time library but
|
|
||||||
// _get_timezone() is so just use it for all builds
|
|
||||||
static long wxGetTimeZone()
|
|
||||||
{
|
|
||||||
static long s_timezone = LONG_MAX; // invalid timezone
|
|
||||||
if ( s_timezone == LONG_MAX )
|
|
||||||
_get_timezone(&s_timezone);
|
|
||||||
|
|
||||||
return s_timezone;
|
|
||||||
}
|
|
||||||
#define WX_TIMEZONE wxGetTimeZone()
|
|
||||||
#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