Skip to content

Commit feff7bc

Browse files
committed
Fix MSVC6 duplicate comdat (LNK1179) with multiple python::range instances
[SVN r20794]
1 parent b12de3f commit feff7bc

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

include/boost/python/converter/shared_ptr_from_python.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct shared_ptr_from_python
1919
converter::registry::insert(&convertible, &construct, type_id<shared_ptr<T> >());
2020
}
2121

22-
static shared_ptr_from_python const registration;
2322
private:
2423
static void* convertible(PyObject* p)
2524
{
@@ -45,9 +44,6 @@ struct shared_ptr_from_python
4544
}
4645
};
4746

48-
template <class T>
49-
shared_ptr_from_python<T> const shared_ptr_from_python<T>::registration;
50-
5147
}}} // namespace boost::python::converter
5248

5349
#endif // SHARED_PTR_FROM_PYTHON_DWA20021130_HPP

include/boost/python/object/class_converters.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
# include <boost/mpl/for_each.hpp>
2020

21+
# include <boost/detail/workaround.hpp>
22+
2123
namespace boost { namespace python { namespace objects {
2224

2325
//////////////////////////////////////////////////////////////////////
@@ -76,8 +78,9 @@ struct register_base_of
7678
template <class Derived, class Bases>
7779
inline void register_class_from_python(Derived* = 0, Bases* = 0)
7880
{
79-
python::detail::force_instantiate(converter::shared_ptr_from_python<Derived>::registration);
80-
81+
// Static object constructor performs registration
82+
static converter::shared_ptr_from_python<Derived> shared_ptr_registration;
83+
8184
// register all up/downcasts here
8285
register_dynamic_id<Derived>();
8386

0 commit comments

Comments
 (0)