Taken from upstream: https://github.com/openbabel/openbabel The TR1 shared_ptr isn't supported on the latest gcc.OB --- include/openbabel/alias.h.orig 2010-09-07 17:07:53 UTC +++ include/openbabel/alias.h @@ -115,7 +115,7 @@ private: } bool FromNameLookup(OBMol& mol, const unsigned int atomindex); #ifdef HAVE_SHARED_POINTER - typedef std::vector< std::pair > > SmartsTable; + typedef std::vector< std::pair > > SmartsTable; static bool LoadFile(SmartsTable& smtable); #endif }; --- include/openbabel/reaction.h.orig 2010-10-10 02:05:12 UTC +++ include/openbabel/reaction.h @@ -35,10 +35,10 @@ namespace OpenBabel class OBReaction : public OBBase { private: - std::vector > _reactants; - std::vector > _products; - shared_ptr _ts; - shared_ptr _agent; + std::vector > _reactants; + std::vector > _products; + obsharedptr _ts; + obsharedptr _agent; std::string _title; std::string _comment; bool _reversible; @@ -52,37 +52,37 @@ public: int NumProducts()const { return static_cast (_products.size()); } - void AddReactant(const shared_ptr sp) + void AddReactant(const obsharedptr sp) { _reactants.push_back(sp); } - void AddProduct(const shared_ptr sp) + void AddProduct(const obsharedptr sp) { _products.push_back(sp); } - void SetTransitionState(const shared_ptr sp) + void SetTransitionState(const obsharedptr sp) { _ts = sp; } - void AddAgent(const shared_ptr sp) + void AddAgent(const obsharedptr sp) { _agent = sp; } - shared_ptr GetReactant(const unsigned i) + obsharedptr GetReactant(const unsigned i) { - shared_ptr sp; + obsharedptr sp; if(i<_reactants.size()) sp = _reactants[i]; return sp; //returns empty if out of range } - shared_ptr GetProduct(const unsigned i) + obsharedptr GetProduct(const unsigned i) { - shared_ptr sp; + obsharedptr sp; if(i<_products.size()) sp = _products[i]; return sp; //returns empty if out of range } - shared_ptr GetTransitionState()const + obsharedptr GetTransitionState()const { return _ts; } - shared_ptr GetAgent()const + obsharedptr GetAgent()const { return _agent; } std::string GetTitle() const { return _title; } --- include/openbabel/shared_ptr.h.orig 2011-10-12 20:24:02 UTC +++ include/openbabel/shared_ptr.h @@ -18,13 +18,21 @@ GNU General Public License for more deta #ifdef USE_BOOST #include - #define shared_ptr boost::shared_ptr + #define obsharedptr boost::shared_ptr #else #include - #if __GNUC__ == 4 //&& __GNUC_MINOR__ < 3 removed at the suggestion of Konstantin Tokarev - #include + #if __GNUC__ >= 4 //&& __GNUC_MINOR__ < 3 removed at the suggestion of Konstantin Tokarev + #ifdef _LIBCPP_VERSION + #include + #else + #include + #endif + #endif + #ifdef _LIBCPP_VERSION + #define obsharedptr std::shared_ptr + #else + #define obsharedptr std::tr1::shared_ptr #endif - using std::tr1::shared_ptr; #endif #endif // OB_SHARED_PTR_H --- scripts/python/openbabel-python.cpp.orig 2012-10-11 19:20:57 UTC +++ scripts/python/openbabel-python.cpp @@ -25531,64 +25531,64 @@ SWIGINTERN PyObject *_wrap_OBReaction_Nu result = (int)((OpenBabel::OBReaction const *)arg1)->NumProducts(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_AddReactant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > arg2 ; + OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 ; int res2 = 0 ; PyObject *swig_obj[2] ; if (!SWIG_Python_UnpackTuple(args,"OBReaction_AddReactant",2,2,swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_AddReactant" "', argument " "1"" of type '" "OpenBabel::OBReaction *""'"); } arg1 = reinterpret_cast< OpenBabel::OBReaction * >(argp1); { res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_AddReactant" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_AddReactant" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_AddReactant" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } - else { shared_ptr< OpenBabel::OBMol > * temp = reinterpret_cast< shared_ptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_AddReactant" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } + else { obsharedptr< OpenBabel::OBMol > * temp = reinterpret_cast< obsharedptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; if (SWIG_IsNewObj(res2)) delete temp; } } (arg1)->AddReactant(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_AddProduct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > arg2 ; + OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 ; int res2 = 0 ; PyObject *swig_obj[2] ; if (!SWIG_Python_UnpackTuple(args,"OBReaction_AddProduct",2,2,swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_AddProduct" "', argument " "1"" of type '" "OpenBabel::OBReaction *""'"); } arg1 = reinterpret_cast< OpenBabel::OBReaction * >(argp1); { res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_AddProduct" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_AddProduct" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_AddProduct" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } - else { shared_ptr< OpenBabel::OBMol > * temp = reinterpret_cast< shared_ptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_AddProduct" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } + else { obsharedptr< OpenBabel::OBMol > * temp = reinterpret_cast< obsharedptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; if (SWIG_IsNewObj(res2)) delete temp; } } (arg1)->AddProduct(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_SetTransitionState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; - SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 ; int res2 = 0 ; + SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 ; int res2 = 0 ; PyObject *swig_obj[2] ; if (!SWIG_Python_UnpackTuple(args,"OBReaction_SetTransitionState",2,2,swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_SetTransitionState" "', argument " "1"" of type '" "OpenBabel::OBReaction *""'"); } arg1 = reinterpret_cast< OpenBabel::OBReaction * >(argp1); { res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_SetTransitionState" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_SetTransitionState" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_SetTransitionState" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } - else { shared_ptr< OpenBabel::OBMol > * temp = reinterpret_cast< shared_ptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_SetTransitionState" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } + else { obsharedptr< OpenBabel::OBMol > * temp = reinterpret_cast< obsharedptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; if (SWIG_IsNewObj(res2)) delete temp; } } (arg1)->SetTransitionState(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_AddAgent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > arg2 ; + OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 ; int res2 = 0 ; PyObject *swig_obj[2] ; if (!SWIG_Python_UnpackTuple(args,"OBReaction_AddAgent",2,2,swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_AddAgent" "', argument " "1"" of type '" "OpenBabel::OBReaction *""'"); } arg1 = reinterpret_cast< OpenBabel::OBReaction * >(argp1); { res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_AddAgent" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OBReaction_AddAgent" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_AddAgent" "', argument " "2"" of type '" "shared_ptr< OpenBabel::OBMol > const""'"); } - else { shared_ptr< OpenBabel::OBMol > * temp = reinterpret_cast< shared_ptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OBReaction_AddAgent" "', argument " "2"" of type '" "obsharedptr< OpenBabel::OBMol > const""'"); } + else { obsharedptr< OpenBabel::OBMol > * temp = reinterpret_cast< obsharedptr< OpenBabel::OBMol > * >(argp2); arg2 = *temp; if (SWIG_IsNewObj(res2)) delete temp; } } (arg1)->AddAgent(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_GetReactant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; unsigned int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned int val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > result; + unsigned int val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > result; if (!SWIG_Python_UnpackTuple(args,"OBReaction_GetReactant",2,2,swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_GetReactant" "', argument " "1"" of type '" "OpenBabel::OBReaction *""'"); } @@ -25596,11 +25596,11 @@ SWIGINTERN PyObject *_wrap_OBReaction_Ge if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OBReaction_GetReactant" "', argument " "2"" of type '" "unsigned int""'"); } arg2 = static_cast< unsigned int >(val2); result = (arg1)->GetReactant(arg2); - resultobj = SWIG_NewPointerObj((new shared_ptr< OpenBabel::OBMol >(static_cast< const shared_ptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new obsharedptr< OpenBabel::OBMol >(static_cast< const obsharedptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_GetProduct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; unsigned int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned int val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > result; + unsigned int val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > result; if (!SWIG_Python_UnpackTuple(args,"OBReaction_GetProduct",2,2,swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_GetProduct" "', argument " "1"" of type '" "OpenBabel::OBReaction *""'"); } @@ -25608,24 +25608,24 @@ SWIGINTERN PyObject *_wrap_OBReaction_Ge if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OBReaction_GetProduct" "', argument " "2"" of type '" "unsigned int""'"); } arg2 = static_cast< unsigned int >(val2); result = (arg1)->GetProduct(arg2); - resultobj = SWIG_NewPointerObj((new shared_ptr< OpenBabel::OBMol >(static_cast< const shared_ptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new obsharedptr< OpenBabel::OBMol >(static_cast< const obsharedptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_GetTransitionState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > result; if (!args) SWIG_fail; swig_obj[0] = args; + PyObject *swig_obj[1] ; SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_GetTransitionState" "', argument " "1"" of type '" "OpenBabel::OBReaction const *""'"); } arg1 = reinterpret_cast< OpenBabel::OBReaction * >(argp1); result = ((OpenBabel::OBReaction const *)arg1)->GetTransitionState(); - resultobj = SWIG_NewPointerObj((new shared_ptr< OpenBabel::OBMol >(static_cast< const shared_ptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new obsharedptr< OpenBabel::OBMol >(static_cast< const obsharedptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_GetAgent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - SwigValueWrapper< shared_ptr< OpenBabel::OBMol > > result; if (!args) SWIG_fail; swig_obj[0] = args; + SwigValueWrapper< obsharedptr< OpenBabel::OBMol > > result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OpenBabel__OBReaction, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OBReaction_GetAgent" "', argument " "1"" of type '" "OpenBabel::OBReaction const *""'"); } arg1 = reinterpret_cast< OpenBabel::OBReaction * >(argp1); result = ((OpenBabel::OBReaction const *)arg1)->GetAgent(); - resultobj = SWIG_NewPointerObj((new shared_ptr< OpenBabel::OBMol >(static_cast< const shared_ptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new obsharedptr< OpenBabel::OBMol >(static_cast< const obsharedptr< OpenBabel::OBMol >& >(result))), SWIGTYPE_p_shared_ptrT_OpenBabel__OBMol_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_OBReaction_GetTitle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OpenBabel::OBReaction *arg1 = (OpenBabel::OBReaction *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; @@ -56173,7 +56173,7 @@ static swig_type_info _swigt__p_p_double static swig_type_info _swigt__p_p_int = {"_p_p_int", "int **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_reference = {"_p_reference", "reference *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_second_type = {"_p_second_type", "second_type *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_shared_ptrT_OpenBabel__OBMol_t = {"_p_shared_ptrT_OpenBabel__OBMol_t", "shared_ptr< OpenBabel::OBMol > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_shared_ptrT_OpenBabel__OBMol_t = {"_p_shared_ptrT_OpenBabel__OBMol_t", "obsharedptr< OpenBabel::OBMol > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__allocatorT_std__vectorT_std__pairT_unsigned_int_unsigned_int_t_std__allocatorT_std__pairT_unsigned_int_unsigned_int_t_t_t_t = {"_p_std__allocatorT_std__vectorT_std__pairT_unsigned_int_unsigned_int_t_std__allocatorT_std__pairT_unsigned_int_unsigned_int_t_t_t_t", "std::allocator< std::vector< std::pair< unsigned int,unsigned int >,std::allocator< std::pair< unsigned int,unsigned int > > > > *|std::vector< std::vector< std::pair< unsigned int,unsigned int > > >::allocator_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__binary_functionT_char_const_p_char_const_p_bool_t = {"_p_std__binary_functionT_char_const_p_char_const_p_bool_t", "std::binary_function< char const *,char const *,bool > *", 0, 0, (void*)0, 0}; --- src/alias.cpp.orig 2012-10-05 20:17:36 UTC +++ src/alias.cpp @@ -21,6 +21,7 @@ GNU General Public License for more deta #include #include #include +#include using namespace std; namespace OpenBabel @@ -270,7 +271,7 @@ bool AliasData::LoadFile(SmartsTable& sm //OBSmartsPattern objects are not copyable without complications, //so reference semantics used. - shared_ptr psp(new OBSmartsPattern); + obsharedptr psp(new OBSmartsPattern); psp->Init(ssmarts.str()); smtable.push_back(make_pair(vec[0], psp)); } --- src/formats/chemkinformat.cpp.orig 2012-10-03 19:08:14 UTC +++ src/formats/chemkinformat.cpp @@ -78,7 +78,7 @@ private: bool ReadHeader(istream& ifs, OBConversion* pConv); bool ParseReactionLine(OBReaction* pReact, OBConversion* pConv); bool ReadReactionQualifierLines(istream& ifs, OBReaction* pReact); - shared_ptr CheckSpecies(string& name, string& ln, bool MustBeKnown); + obsharedptr CheckSpecies(string& name, string& ln, bool MustBeKnown); bool ReadThermo(OBConversion* pConv); bool ReadStdThermo(const string& datafilename); OBFormat* GetThermoFormat(); @@ -86,8 +86,8 @@ private: bool WriteReactionLine(OBReaction* pReact, OBConversion* pConv); bool WriteHeader(OBConversion* pConv); private: - typedef map > MolMap; - typedef set > MolSet; + typedef map > MolMap; + typedef set > MolSet; //used on input MolMap IMols; string ln; @@ -215,7 +215,7 @@ void ChemKinFormat::Init() SpeciesListed=false; IMols.clear(); //Special species name - shared_ptr sp(new OBMol); + obsharedptr sp(new OBMol); sp.get()->SetTitle("M"); IMols["M"] = sp; } @@ -280,7 +280,7 @@ bool ChemKinFormat::ReadHeader(istream& break; } //Add all species to IMols - shared_ptr sp(new OBMol); + obsharedptr sp(new OBMol); sp.get()->SetTitle(*itr); IMols[*itr] = sp; } @@ -346,7 +346,7 @@ bool ChemKinFormat::ParseReactionLine(OB OBRateData* pRD = new OBRateData; //to store rate constant data. Attach only if rate data found int n=0; - shared_ptr sp; + obsharedptr sp; string::size_type eqpos = ln.find('='); @@ -643,7 +643,7 @@ bool ChemKinFormat::ReadReactionQualifie } /////////////////////////////////////////////////////////////// -shared_ptr ChemKinFormat::CheckSpecies(string& name, string& ln, bool MustBeKnown) +obsharedptr ChemKinFormat::CheckSpecies(string& name, string& ln, bool MustBeKnown) { MolMap::iterator mapitr = IMols.find(name); if(mapitr==IMols.end()) @@ -653,14 +653,14 @@ shared_ptr ChemKinFormat::CheckSp { obErrorLog.ThrowError(__FUNCTION__, name + " not recognized as a species in\n" + ln, obError); - shared_ptr sp; + obsharedptr sp; return sp; //empty } else { // There was no REACTIONS section in input file and probably no SPECIES section. // Unknown species that appear in a reaction can be made here with just a name. - shared_ptr sp(new OBMol); + obsharedptr sp(new OBMol); sp->SetTitle(name.c_str()); return sp; } @@ -697,7 +697,7 @@ bool ChemKinFormat::ReadThermo(OBConvers MolMap::iterator mapitr = IMols.find(thmol.GetTitle()); if(mapitr!=IMols.end()) { - shared_ptr psnewmol(OBMoleculeFormat::MakeCombinedMolecule(mapitr->second.get(),&thmol)); + obsharedptr psnewmol(OBMoleculeFormat::MakeCombinedMolecule(mapitr->second.get(),&thmol)); IMols.erase(mapitr); IMols[thmol.GetTitle()] = psnewmol; } @@ -743,7 +743,7 @@ bool ChemKinFormat::ReadStdThermo(const OBMol thmol; stdthermo.seekg(itr->second); StdThermConv.Read(&thmol); - shared_ptr psnewmol(OBMoleculeFormat::MakeCombinedMolecule(mapitr->second.get(),&thmol)); + obsharedptr psnewmol(OBMoleculeFormat::MakeCombinedMolecule(mapitr->second.get(),&thmol)); IMols[thmol.GetTitle()] = psnewmol; } else @@ -915,7 +915,7 @@ bool ChemKinFormat::WriteReactionLine(OB int i; for(i=0;iNumReactants();++i) { - shared_ptr psMol = pReact->GetReactant(i); + obsharedptr psMol = pReact->GetReactant(i); // if(strcasecmp(psMol->GetTitle(),"M")) OMols.insert(psMol); @@ -954,7 +954,7 @@ bool ChemKinFormat::WriteReactionLine(OB for(i=0;iNumProducts();++i) { - shared_ptr psMol = pReact->GetProduct(i); + obsharedptr psMol = pReact->GetProduct(i); if(strcasecmp(psMol->GetTitle(),"M")) OMols.insert(psMol); --- src/formats/rsmiformat.cpp.orig 2012-10-03 19:08:14 UTC +++ src/formats/rsmiformat.cpp @@ -181,7 +181,7 @@ namespace OpenBabel } mols = jreactants.Separate(); for(itr=mols.begin();itr!=mols.end();++itr) - pReact->AddReactant(shared_ptr(new OBMol(*itr))); + pReact->AddReactant(obsharedptr(new OBMol(*itr))); pos2 = rsmiles.find('>', pos+1); if(pos2==string::npos) @@ -201,7 +201,7 @@ namespace OpenBabel delete pAgent; return false; } - pReact->AddAgent(shared_ptr(pAgent)); + pReact->AddAgent(obsharedptr(pAgent)); } //Extract products and split into separate molecules @@ -215,7 +215,7 @@ namespace OpenBabel mols.clear(); mols = jproducts.Separate(); for(itr=mols.begin();itr!=mols.end();++itr) - pReact->AddProduct(shared_ptr(new OBMol(*itr))); + pReact->AddProduct(obsharedptr(new OBMol(*itr))); return true; } @@ -247,7 +247,7 @@ namespace OpenBabel ofs << '>'; - shared_ptr spAgent = pReact->GetAgent(); + obsharedptr spAgent = pReact->GetAgent(); if(spAgent.get()) if(!pSmiFormat->WriteMolecule(spAgent.get(), pConv)) return false; --- src/formats/rxnformat.cpp.orig 2012-10-03 19:08:14 UTC +++ src/formats/rxnformat.cpp @@ -175,7 +175,7 @@ bool RXNFormat::ReadMolecule(OBBase* pOb obErrorLog.ThrowError(__FUNCTION__, "Failed to read a reactant", obWarning); else { - shared_ptr p(pmol); + obsharedptr p(pmol); pReact->AddReactant(p); } } @@ -189,7 +189,7 @@ bool RXNFormat::ReadMolecule(OBBase* pOb else { // pReact->products.push_back(pmol); - shared_ptr p(pmol); + obsharedptr p(pmol); pReact->AddProduct(p); } } --- src/formats/xml/cmlreactformat.cpp.orig 2012-10-03 19:08:13 UTC +++ src/formats/xml/cmlreactformat.cpp @@ -91,15 +91,15 @@ public: }; private: - typedef map > MolMap; - string AddMolToList(shared_ptr spmol, MolMap& mmap); + typedef map > MolMap; + string AddMolToList(obsharedptr spmol, MolMap& mmap); bool WriteRateData(OBReaction* pReact, xmlChar* altprefix); void WriteMetadataList(OBReaction& react); private: OBReaction* _preact; OBMol* pmol; - shared_ptr _spmol; + obsharedptr _spmol; MolMap IMols; //used on input MolMap OMols; //used on output int nextmol; @@ -123,7 +123,7 @@ bool CMLReactFormat::ReadChemObject(OBCo { IMols.clear(); //add special species - shared_ptr sp(new OBMol); + obsharedptr sp(new OBMol); sp.get()->SetTitle("M"); IMols["M"] = sp; } @@ -192,7 +192,7 @@ bool CMLReactFormat::DoElement(const str } else { - shared_ptr sp(new OBMol); + obsharedptr sp(new OBMol); OBFormat* pCMLFormat = OBConversion::FindFormat("cml"); if(!pCMLFormat) return false; @@ -331,7 +331,7 @@ bool CMLReactFormat::WriteChemObject(OBC OBMol* pmol = dynamic_cast(pOb); if(pmol!=NULL) { - shared_ptr sp(pmol); + obsharedptr sp(pmol); AddMolToList(sp, OMols); pConv->SetOutputIndex(-1); //Signals that molecules have been added @@ -624,7 +624,7 @@ bool CMLReactFormat::WriteMolecule(OBBas return true; } -string CMLReactFormat::AddMolToList(shared_ptr spmol, MolMap& mmap) +string CMLReactFormat::AddMolToList(obsharedptr spmol, MolMap& mmap) { //Adds a molecule to the map string id = spmol->GetTitle(); @@ -664,7 +664,7 @@ string CMLReactFormat::AddMolToList(shar { //already in map. //Get a molecule with the best bits of both old and new molecules and immediately make a shared_ ptr - shared_ptr spnew(OBMoleculeFormat::MakeCombinedMolecule(mapitr->second.get(), spmol.get())); + obsharedptr spnew(OBMoleculeFormat::MakeCombinedMolecule(mapitr->second.get(), spmol.get())); if(spnew) { spmol.swap(spnew); --- src/obmolecformat.cpp.orig 2012-10-03 19:08:15 UTC +++ src/obmolecformat.cpp @@ -439,7 +439,7 @@ namespace OpenBabel //Output all the constituent molecules of the reaction //Collect the molecules first, just for convenience - vector > mols; + vector > mols; unsigned i; for(i=0;iNumReactants();i++) mols.push_back(pReact->GetReactant(i)); --- test/obtest.h.orig 2010-09-22 04:05:05 UTC +++ test/obtest.h @@ -40,7 +40,7 @@ const char* ob_expr(const char *expr) { // some utility functions -typedef shared_ptr OBMolPtr; +typedef obsharedptr OBMolPtr; struct OBTestUtil {