2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

Fix MSVC6 duplicate comdat (LNK1179) with multiple python::range instances

[SVN r20794]
This commit is contained in:
Raoul Gough
2003-11-12 16:50:17 +00:00
parent b12de3f01b
commit feff7bccd3
2 changed files with 5 additions and 6 deletions

View File

@@ -19,7 +19,6 @@ struct shared_ptr_from_python
converter::registry::insert(&convertible, &construct, type_id<shared_ptr<T> >());
}
static shared_ptr_from_python const registration;
private:
static void* convertible(PyObject* p)
{
@@ -45,9 +44,6 @@ struct shared_ptr_from_python
}
};
template <class T>
shared_ptr_from_python<T> const shared_ptr_from_python<T>::registration;
}}} // namespace boost::python::converter
#endif // SHARED_PTR_FROM_PYTHON_DWA20021130_HPP

View File

@@ -18,6 +18,8 @@
# include <boost/mpl/for_each.hpp>
# include <boost/detail/workaround.hpp>
namespace boost { namespace python { namespace objects {
//////////////////////////////////////////////////////////////////////
@@ -76,8 +78,9 @@ struct register_base_of
template <class Derived, class Bases>
inline void register_class_from_python(Derived* = 0, Bases* = 0)
{
python::detail::force_instantiate(converter::shared_ptr_from_python<Derived>::registration);
// Static object constructor performs registration
static converter::shared_ptr_from_python<Derived> shared_ptr_registration;
// register all up/downcasts here
register_dynamic_id<Derived>();