#pragma interface "datetime.h"
#endif
+#if wxUSE_DATETIME
+
#include <time.h>
#include <limits.h> // for INT_MIN
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
// wxInvalidDateTime)
class WXDLLEXPORT wxDateTime;
-WXDLLEXPORT_DATA(extern const wxDateTime&) wxDefaultDateTime;
+WXDLLEXPORT_DATA(extern const wxDateTime) wxDefaultDateTime;
#define wxInvalidDateTime wxDefaultDateTime
// ----------------------------------------------------------------------------
// ------------------------------------------------------------------------
// 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))
// 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
// 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
: (wxDateTime::WeekDay)(wd - 1);
}
+#endif // wxUSE_DATETIME
+
#endif // _WX_DATETIME_H