Salome HOME
Fix usage of Boost smart pointers for compatibility with Boost >= 1.53
authorRenaud Barate <renaud.barate@edf.fr>
Thu, 20 Mar 2014 14:42:11 +0000 (15:42 +0100)
committerRenaud Barate <renaud.barate@edf.fr>
Thu, 20 Mar 2014 14:42:11 +0000 (15:42 +0100)
src/DF/DF_definitions.hxx
src/DF/testDF.cxx
src/SALOMEDSClient/SALOMEDSClient_definitions.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx
src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx

index 062775c09e3567a9d96d0e60accb783ca49e37e8..e3f163f0e82393336ef63f4fd19172d3ca96ce47 100644 (file)
 
 #include <iostream> 
 #include <stdio.h>
-#include <boost/shared_ptr.hpp> 
-
-template<class T> class df_shared_ptr: public boost::shared_ptr<T>
-{
-public:
-  df_shared_ptr() {}
-  
-  template<class Y>
-    explicit df_shared_ptr(Y * p)
-      {
-        boost::shared_ptr<T>::reset(p);
-      }
-  
-  template<class Y>
-    df_shared_ptr(df_shared_ptr<Y> const & r):
-      boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
-        {}
-  
-  template<class Y>
-    df_shared_ptr & operator=(df_shared_ptr<Y> const & r)
-      {
-        df_shared_ptr<T>(r).swap(*this);
-        return *this;
-      }
-  
-  template<class Y> df_shared_ptr& operator()(Y * p) // Y must be complete
-    {
-      if(T* pt = dynamic_cast<T*>(p))
-        boost::shared_ptr<T>::reset(pt);
-      else
-        boost::throw_exception(std::bad_cast());
-      return *this;
-    }
-    
-};
 
 # if defined(WIN32) && !defined(HAVE_NO_DLL)
 
index e9a2f31acd94c0f06b3882e5a5d305f54cb37762..9c4ba63937b31d811f661c239674385c7ce8054e 100644 (file)
@@ -35,6 +35,7 @@
 #include "DF_ChildIterator.hxx"
 
 #ifndef WIN32
+#include <unistd.h>
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <sys/types.h>
index ba62dc855b6f12e37fef160b2c1074246bc86239..3d67dfcd6d7b9e86a20be9bfb39b516b89ee07b5 100644 (file)
@@ -45,12 +45,12 @@ public:
       {
         boost::shared_ptr<T>::reset(p);
       }
-  
+
   template<class Y>
     clt_shared_ptr(clt_shared_ptr<Y> const & r):
-      boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
+      boost::shared_ptr<T>(boost::dynamic_pointer_cast<T,Y>(r))
         {}
-  
+
   template<class Y>
     clt_shared_ptr & operator=(clt_shared_ptr<Y> const & r)
       {
index 1b4e2acf8e4da10f82ba360baa253919808d6628..493d7024f1d40a6f8dbb82e36027270b987842bd 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : SALOME
 //
 #include "SALOMEDSImpl_AttributeLocalID.hxx"
+#include <stdlib.h>
 
 //=======================================================================
 //function : GetID
index caa77254e2dd5ad20a7bc6bb39c43b2115b6daec..0762725e16d0920a0b4c6b081655a17297a1ec15 100644 (file)
@@ -26,6 +26,7 @@
 //
 #include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
 #include <string.h>
+#include <stdlib.h>
 
 //=======================================================================
 //function : GetID
index 05052ad749066932d2fc3ca1843722530eae0357..6c7bc5568e8f19f6e94c01d8d0bbf831b866fc6b 100644 (file)
@@ -26,6 +26,7 @@
 //
 #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
 #include <string.h>
+#include <stdlib.h>
 
 //=======================================================================
 //function : GetID
index feb5907caf93cce27c907c3ce335554902ec74dd..ead169e3bdf8e912922e134d698c5a2a1de8d996 100644 (file)
@@ -26,6 +26,7 @@
 //
 #include "SALOMEDSImpl_AttributeStudyProperties.hxx"
 #include <string.h>
+#include <stdlib.h>
 
 const std::string& SALOMEDSImpl_AttributeStudyProperties::GetID()
 {
index 80373654a6dbf4c0716b6db40ba7dc4406c127af..fe847ed61eebd1cffea36492fe588c292104327c 100644 (file)
@@ -26,6 +26,7 @@
 #include "SALOMEDSImpl_Study.hxx"
 
 #include <string>
+#include <stdlib.h>
 
 
 //============================================================================