Эх сурвалжийг харах

bug fixes for macosx

Former-commit-id: 5e402daed9ad1ad644a38a570ce5398fa40f6f8e
Daniele Panozzo 10 жил өмнө
parent
commit
eae644e8f4

+ 10 - 10
include/igl/serialize.cpp

@@ -19,7 +19,7 @@ namespace igl
   IGL_INLINE bool serialize(const T& obj,const std::string& objectName,const std::string& filename,bool overwrite)
   {
     bool success = false;
-    
+
     std::vector<char> buffer;
 
     std::ios_base::openmode mode = std::ios::out | std::ios::binary;
@@ -28,7 +28,7 @@ namespace igl
       mode |= std::ios::trunc;
     else
       mode |= std::ios::app;
-    
+
     std::ofstream file(filename.c_str(),mode);
 
     if(file.is_open())
@@ -103,7 +103,7 @@ namespace igl
 
       deserialize(obj,objectName,buffer);
       file.close();
-      
+
       success = true;
     }
     else
@@ -116,7 +116,7 @@ namespace igl
 
   template <typename T>
   IGL_INLINE bool deserialize(T& obj,const std::string& objectName,const std::vector<char>& buffer)
-  {   
+  {
     bool success = false;
 
     // find suitable object header
@@ -225,7 +225,7 @@ namespace igl
       {
         v->Deserialize(buffer);
       }
-          
+
       this->PostDeserialization();
     }
   }
@@ -648,7 +648,7 @@ namespace igl
         if(obj)
           std::cout << "deserialization: possible memory leak for '" << typeid(obj).name() << "'" << std::endl;
 
-        obj = new std::remove_pointer<T>::type();
+        obj = new typename std::remove_pointer<T>::type();
         serialization::deserialize(*obj,iter);
       }
     }
@@ -685,7 +685,7 @@ namespace igl
     }
 
     // std::weak_ptr
-    
+
     template <typename T>
     IGL_INLINE size_t getByteSize(const std::weak_ptr<T>& obj)
     {
@@ -708,13 +708,13 @@ namespace igl
     template <typename T>
     IGL_INLINE void serialize(const T& obj,std::vector<char>& buffer)
     {
-      static_assert(false,"type is not serializable: derive from igl::Serializable or overload the function igl::serialization::serialize(const T& obj,std::vector<char>& buffer)");
+      std::cerr << typeid(obj).name() << " is not serializable: derive from igl::Serializable or overload the function igl::serialization::serialize(const T& obj,std::vector<char>& buffer)" << std::endl;
     }
 
     template <typename T>
     IGL_INLINE void deserialize(T& obj,const std::vector<char>& buffer)
     {
-      static_assert(false,"type is not serializable: derive from igl::Serializable or overload the function igl::serialization::deserialize(const T& obj,std::vector<char>& buffer)");
+      std::cerr << typeid(obj).name() << " is not drserializable: derive from igl::Serializable or overload the function igl::serialization::deserialize(T& obj, const std::vector<char>& buffer)" << std::endl;
     }
 
     // helper functions
@@ -747,7 +747,7 @@ namespace igl
       else
       {
         // already serialized
-        
+
         // remove inserted address
         memoryMap.erase(el.first);
       }

+ 1 - 1
include/igl/xml/serialize_xml.h

@@ -253,7 +253,7 @@ namespace igl
 }
 
 #ifndef IGL_STATIC_LIBRARY
-  #include "serialize_xml.cpp";
+  #include "serialize_xml.cpp"
 #endif
 
 #endif