]> git.saurik.com Git - wxWidgets.git/commitdiff
Revised timezone fix
authorJulian Smart <julian@anthemion.co.uk>
Tue, 21 Aug 2007 13:57:11 +0000 (13:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 21 Aug 2007 13:57:11 +0000 (13:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datetime.cpp

index c57875ad35afc6d591caaa045723bf14e40397b7..a6758a896af40e3ac8f075b8d4d5ac93e25f2498 100644 (file)
@@ -173,6 +173,21 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter<wxDateTime> , wxFromStringCon
     #elif defined(__WXWINCE__) && defined(__VISUALC8__)
         // _timezone is not present in dynamic run-time library
         #if 1
     #elif defined(__WXWINCE__) && defined(__VISUALC8__)
         // _timezone is not present in dynamic run-time library
         #if 1
+        // Solution (1): use the function equivalent of _timezone
+        static long wxGetTimeZone()
+        {
+            static long s_Timezone = MAXLONG; // invalid timezone
+            if (s_Timezone == MAXLONG)
+            {
+                int t;
+                _get_timezone(& t);
+                s_Timezone = (long) t;
+            }
+            return s_Timezone;
+        }
+        #define WX_TIMEZONE wxGetTimeZone()
+        #elif 0
+        // Solution (2): using GetTimeZoneInformation
         static long wxGetTimeZone()
         {
             static long timezone = MAXLONG; // invalid timezone
         static long wxGetTimeZone()
         {
             static long timezone = MAXLONG; // invalid timezone
@@ -186,6 +201,7 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter<wxDateTime> , wxFromStringCon
         }
         #define WX_TIMEZONE wxGetTimeZone()
         #else
         }
         #define WX_TIMEZONE wxGetTimeZone()
         #else
+        // Old method using _timezone: this symbol doesn't exist in the dynamic run-time library (i.e. using /MD)
         #define WX_TIMEZONE _timezone
         #endif
     #else // unknown platform - try timezone
         #define WX_TIMEZONE _timezone
         #endif
     #else // unknown platform - try timezone