cache return value of ftime
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -102,14 +102,20 @@
|
|||||||
#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__)
|
#elif defined(__DJGPP__)
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
|
#include <values.h>
|
||||||
static long wxGetTimeZone()
|
static long wxGetTimeZone()
|
||||||
{
|
{
|
||||||
struct timeb tb;
|
static long timezone = MAXLONG; // invalid timezone
|
||||||
ftime(&tb);
|
if (timezone == MAXLONG)
|
||||||
return tb.timezone;
|
{
|
||||||
|
struct timeb tb;
|
||||||
|
ftime(&tb);
|
||||||
|
timezone = tb.timezone;
|
||||||
|
}
|
||||||
|
return timezone;
|
||||||
}
|
}
|
||||||
#define WX_TIMEZONE wxGetTimeZone()
|
#define WX_TIMEZONE wxGetTimeZone()
|
||||||
#else // unknown platform - try timezone
|
#else // unknown platform - try timezone
|
||||||
|
Reference in New Issue
Block a user