From feff7bccd398910bf5e0540220248c5da206a401 Mon Sep 17 00:00:00 2001 From: Raoul Gough Date: Wed, 12 Nov 2003 16:50:17 +0000 Subject: [PATCH] Fix MSVC6 duplicate comdat (LNK1179) with multiple python::range instances [SVN r20794] --- include/boost/python/converter/shared_ptr_from_python.hpp | 4 ---- include/boost/python/object/class_converters.hpp | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/boost/python/converter/shared_ptr_from_python.hpp b/include/boost/python/converter/shared_ptr_from_python.hpp index 1535740a..5b7d5441 100644 --- a/include/boost/python/converter/shared_ptr_from_python.hpp +++ b/include/boost/python/converter/shared_ptr_from_python.hpp @@ -19,7 +19,6 @@ struct shared_ptr_from_python converter::registry::insert(&convertible, &construct, type_id >()); } - static shared_ptr_from_python const registration; private: static void* convertible(PyObject* p) { @@ -45,9 +44,6 @@ struct shared_ptr_from_python } }; -template -shared_ptr_from_python const shared_ptr_from_python::registration; - }}} // namespace boost::python::converter #endif // SHARED_PTR_FROM_PYTHON_DWA20021130_HPP diff --git a/include/boost/python/object/class_converters.hpp b/include/boost/python/object/class_converters.hpp index b9cf4a43..a891c994 100644 --- a/include/boost/python/object/class_converters.hpp +++ b/include/boost/python/object/class_converters.hpp @@ -18,6 +18,8 @@ # include +# include + namespace boost { namespace python { namespace objects { ////////////////////////////////////////////////////////////////////// @@ -76,8 +78,9 @@ struct register_base_of template inline void register_class_from_python(Derived* = 0, Bases* = 0) { - python::detail::force_instantiate(converter::shared_ptr_from_python::registration); - + // Static object constructor performs registration + static converter::shared_ptr_from_python shared_ptr_registration; + // register all up/downcasts here register_dynamic_id();