X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5cd97870d58ebf1fa2267299f80b864281884c6..82df67d960355e99a66b1db473b9d6236bf2fbb9:/include/wx/datetime.h?ds=sidebyside diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 92398e53f2..017c226b89 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -17,6 +17,8 @@ #pragma interface "datetime.h" #endif +#if wxUSE_DATETIME + #include #include // for INT_MIN @@ -26,14 +28,20 @@ class WXDLLEXPORT wxDateTime; class WXDLLEXPORT wxTimeSpan; class WXDLLEXPORT wxDateSpan; -// don't use inline functions in debug builds - we don't care about +// a hack: don't use inline functions in debug builds - we don't care about // performances and this only leads to increased rebuild time (because every // time an inline method is changed, all files including the header must be // rebuilt) -// For Mingw32, causes a link error. + +// For Mingw32, causes a link error. (VZ: why?) #if defined( __WXDEBUG__) && !defined(__MINGW32__) + #define wxDATETIME_DONT_INLINE + #undef inline #define inline +#else + // just in case + #undef wxDATETIME_DONT_INLINE #endif // Debug // not all c-runtimes are based on 1/1/1970 being (time_t) 0 @@ -113,7 +121,7 @@ class WXDLLEXPORT wxDateSpan; // wxInvalidDateTime) class WXDLLEXPORT wxDateTime; -WXDLLEXPORT_DATA(extern const wxDateTime&) wxDefaultDateTime; +WXDLLEXPORT_DATA(extern const wxDateTime) wxDefaultDateTime; #define wxInvalidDateTime wxDefaultDateTime // ---------------------------------------------------------------------------- @@ -539,7 +547,7 @@ public: // ------------------------------------------------------------------------ // default ctor does not initialize the object, use Set()! - wxDateTime() { } + wxDateTime() { m_time = wxLongLong((long)ULONG_MAX, ULONG_MAX); } // from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970) #if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) @@ -773,8 +781,7 @@ public: // result of timezone shift) // ------------------------------------------------------------------------ - // is the date valid? Note that this will return TRUE for non - // initialized objects but FALSE if *this == wxInvalidDateTime + // is the date valid? inline bool IsValid() const { return m_time != wxInvalidDateTime.m_time; } // get the broken down date/time representation in the given timezone @@ -1335,14 +1342,16 @@ protected: // else than datetime.cpp in debug builds: this minimizes rebuilds if we change // some inline function and the performance doesn't matter in the debug builds. -#if !defined(__WXDEBUG__) || defined(wxDEFINE_TIME_CONSTANTS) +#if !defined(wxDATETIME_DONT_INLINE) || defined(wxDEFINE_TIME_CONSTANTS) #define INCLUDED_FROM_WX_DATETIME_H #include "wx/datetime.inl" #undef INCLUDED_FROM_WX_DATETIME_H #endif // if we defined it to be empty above, restore it now -#undef inline +#ifdef wxDATETIME_DONT_INLINE + #undef inline +#endif // ============================================================================ // binary operators @@ -1571,4 +1580,6 @@ inline WXDLLEXPORT void wxPrevWDay(wxDateTime::WeekDay& wd) : (wxDateTime::WeekDay)(wd - 1); } +#endif // wxUSE_DATETIME + #endif // _WX_DATETIME_H