From c4e1b7f244ce0187974d9a19d540733921add9b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 16 Dec 2001 20:35:05 +0000 Subject: [PATCH] cache return value of ftime git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datetime.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 23080fef24..7dc3120194 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -102,14 +102,20 @@ #define WX_TIMEZONE _timezone #elif defined(__MWERKS__) long wxmw_timezone = 28800; - #define WX_TIMEZONE wxmw_timezone; + #define WX_TIMEZONE wxmw_timezone #elif defined(__DJGPP__) #include + #include static long wxGetTimeZone() { - struct timeb tb; - ftime(&tb); - return tb.timezone; + static long timezone = MAXLONG; // invalid timezone + if (timezone == MAXLONG) + { + struct timeb tb; + ftime(&tb); + timezone = tb.timezone; + } + return timezone; } #define WX_TIMEZONE wxGetTimeZone() #else // unknown platform - try timezone -- 2.50.0