]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/serbase.cpp
reverted the fix for Unicode compilation with VC++ as it breaks other ports (and...
[wxWidgets.git] / src / common / serbase.cpp
index 803893ec9c7696751b27eb0a03a197d77736da40..6b89bea73d59ac11fb6b3181beb8ec9cade98c6c 100644 (file)
 #pragma implementation "serbase.h"
 #endif
 
-#ifdef wxUSE_SERIAL
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
+#if defined(__WINDOWS__)
+#include "wx/msw/private.h"
+#endif
 
 #include "wx/serbase.h"
 #include "wx/datstrm.h"
 #pragma hdrstop
 #endif
 
+#if wxUSE_SERIAL
+
 // ----------------------------------------------------------------------------
 // wxObject_Serialize
 // ----------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxObject_Serialize,wxObject)
+
 IMPLEMENT_SERIAL_CLASS(wxList, wxObject)
 IMPLEMENT_SERIAL_CLASS(wxHashTable, wxObject)
-#endif
 
 void WXSERIAL(wxList)::StoreObject(wxObjectOutputStream& s)
 {
@@ -57,7 +59,7 @@ void WXSERIAL(wxList)::StoreObject(wxObjectOutputStream& s)
 
   if (lst_object->GetKeyType() == wxKEY_INTEGER) {
     while (node) {
-      data_s.Write32(node->GetKeyInteger());
+      data_s.Write32((size_t)node->GetKeyInteger());
       node = node->Next();
     }
   } else {
@@ -74,7 +76,7 @@ void WXSERIAL(wxList)::LoadObject(wxObjectInputStream& s)
   wxList *list = (wxList *)Object();
   int number, i;
 
-  list->DeleteContents( data_s.Read8() );
+  list->DeleteContents( data_s.Read8() != 0 );
   list->SetKeyType( (wxKeyType) data_s.Read8() );
   number = data_s.Read32();
 
@@ -121,4 +123,4 @@ void WXSERIAL(wxHashTable)::LoadObject(wxObjectInputStream& s)
     table->hash_table[i] = (wxList *)s.GetChild();
 }
 
-#endif
+#endif // wxUSE_SERIAL