]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
added wxBuildOptions and check that they are the same for the program and the library...
[wxWidgets.git] / src / common / datetime.cpp
index 02ab38450cd3c37ac09b1d38d763f5ab63b7dea4..418a72f51c89faad35ac925dcfc6396774254732 100644 (file)
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
+
 #ifndef WX_PRECOMP
     #include "wx/string.h"
 #ifndef WX_PRECOMP
     #include "wx/string.h"
-    #include "wx/intl.h"
     #include "wx/log.h"
 #endif // WX_PRECOMP
 
     #include "wx/log.h"
 #endif // WX_PRECOMP
 
+#include "wx/intl.h"
 #include "wx/thread.h"
 #include "wx/tokenzr.h"
 #include "wx/module.h"
 #include "wx/thread.h"
 #include "wx/tokenzr.h"
 #include "wx/module.h"
         #define WX_TIMEZONE _timezone
     #elif defined(__MWERKS__)
         long wxmw_timezone = 28800;
         #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 <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()
     #else // unknown platform - try timezone
         #define WX_TIMEZONE timezone
     #endif
     #else // unknown platform - try timezone
         #define WX_TIMEZONE timezone
     #endif
@@ -194,10 +211,7 @@ static const wxDateTime::wxDateTime_t gs_cumulatedDays[2][MONTHS_IN_YEAR] =
 
 // in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to
 // indicate an invalid wxDateTime object
 
 // in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to
 // indicate an invalid wxDateTime object
-
-static const wxDateTime gs_dtDefault;
-
-const wxDateTime& wxDefaultDateTime = gs_dtDefault;
+const wxDateTime wxDefaultDateTime;
 
 wxDateTime::Country wxDateTime::ms_country = wxDateTime::Country_Unknown;
 
 
 wxDateTime::Country wxDateTime::ms_country = wxDateTime::Country_Unknown;
 
@@ -3711,4 +3725,4 @@ size_t wxDateTimeWorkDays::DoGetHolidaysInRange(const wxDateTime& dtStart,
     return holidays.GetCount();
 }
 
     return holidays.GetCount();
 }
 
-
+#endif // wxUSE_DATETIME