]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/variant.cpp
Various VC++ 1.5 and other corrections
[wxWidgets.git] / src / common / variant.cpp
index 3acdd76f4f0a844d043be7facc1df7d9ab6e4c3f..491cf8c470820e97c88a45285030123f82a62030 100644 (file)
@@ -11,6 +11,8 @@
 
 #ifdef __GNUG__
 #pragma implementation "variant.h"
+#pragma implementation "time.h"
+#pragma implementation "date.h"
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/string.h"
 #include "wx/variant.h"
 
+IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
+IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
+
+wxTime::tFormat    wxTime::ms_Format    = wxTime::wx12h;
+wxTime::tPrecision wxTime::ms_Precision  = wxTime::wxStdMinSec;
+
 IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
 
 wxVariant WXDLLEXPORT wxNullVariant;
@@ -379,7 +387,7 @@ bool wxVariantDataLong::Write(wxOutputStream& str) const
 {
     wxTextOutputStream s(str);
 
-    s.Write32(m_value);
+    s.Write32((size_t)m_value);
     return TRUE;
 }
 
@@ -820,7 +828,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataString, wxVariantData)
  * wxVariantDataTime
  */
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 
 class wxVariantDataTime: public wxVariantData
 {
@@ -1127,7 +1136,8 @@ wxVariant::wxVariant(const wxList& val, const wxString& name) // List of variant
     m_name = name;
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 wxVariant::wxVariant(const wxTime& val, const wxString& name) // Time
 {
     m_data = new wxVariantDataTime(val);
@@ -1431,7 +1441,8 @@ void wxVariant::operator= (const wxList& value)
     }
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 bool wxVariant::operator== (const wxTime& value) const
 {
     wxTime thisValue;
@@ -1664,7 +1675,8 @@ wxString wxVariant::GetString() const
     }
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 wxTime wxVariant::GetTime() const
 {
     wxTime value;
@@ -1864,7 +1876,8 @@ bool wxVariant::Convert(wxString* value) const
     return TRUE;
 }
 
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
 bool wxVariant::Convert(wxTime* value) const
 {
     wxString type(GetType());
@@ -1890,3 +1903,4 @@ bool wxVariant::Convert(wxDate* value) const
 }
 #endif
  // wxUSE_TIMEDATE
+