Index: D:/boost/boost.build/libs/serialization/test/Jamfile.v2 =================================================================== --- D:/boost/boost.build/libs/serialization/test/Jamfile.v2 (revision 138381) +++ D:/boost/boost.build/libs/serialization/test/Jamfile.v2 (revision 138382) @@ -25,6 +25,14 @@ BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; +lib dll_base_lib : dll_base.cpp : shared ; +lib dll_derived2_lib + : dll_derived2.cpp + dll_base_lib + /boost/serialization//boost_serialization + : shared + ; + test-suite "serialization" : [ test-bsl-run_files test_array : A ] [ test-bsl-run_files test_binary ] @@ -34,6 +42,7 @@ [ test-bsl-run_files test_delete_pointer ] [ test-bsl-run_files test_deque : A ] # [ test-bsl-run_files test_derived ] + [ test-bsl-run test_dll_exported : : : dll_base_lib dll_derived2_lib ] [ test-bsl-run_files test_derived_class : A ] [ test-bsl-run_files test_derived_class_ptr : A ] [ test-bsl-run_files test_diamond ] Index: D:/boost/boost.build/libs/serialization/src/void_cast.cpp =================================================================== --- D:/boost/boost.build/libs/serialization/src/void_cast.cpp (revision 138381) +++ D:/boost/boost.build/libs/serialization/src/void_cast.cpp (revision 138382) @@ -40,6 +40,12 @@ } }; +struct void_caster_weak_equal : std::binary_function { + bool operator()(const void_caster * lhs, const void_caster * rhs) const { + return *lhs->m_base == *rhs->m_base && *lhs->m_derived == *rhs->m_derived; + } +}; + typedef std::set set_type; typedef boost::serialization::singleton void_caster_registry; @@ -218,8 +224,20 @@ s.erase(it); } +set_type::const_iterator +find( + set_type const & s, + void_caster_argument const & ca) +{ + set_type::const_iterator const it(s.find(&ca)); + if (s.end() != it) + return it; + else + return std::find_if( + s.begin(), s.end(), + std::bind1st(void_caster_weak_equal(), &ca)); +} - } // namespace void_cast_detail // Given a void *, assume that it really points to an instance of one type @@ -242,7 +260,7 @@ void_cast_detail::void_caster_argument ca(& derived, & base); void_cast_detail::set_type::const_iterator it; - it = s.find(& ca); + it = void_cast_detail::find(s, ca); if (s.end() != it) return (*it)->upcast(t); @@ -265,7 +283,7 @@ void_cast_detail::void_caster_argument ca(& derived, & base); void_cast_detail::set_type::const_iterator it; - it = s.find(&ca); + it = void_cast_detail::find(s, ca); if (s.end() != it) return(*it)->downcast(t); Index: D:/boost/boost.build/libs/serialization/util/test.jam =================================================================== --- D:/boost/boost.build/libs/serialization/util/test.jam (revision 138381) +++ D:/boost/boost.build/libs/serialization/util/test.jam (revision 138382) @@ -113,13 +113,13 @@ return $(tests) ; } -rule test-bsl-run ( test-name : sources * : requirements * ) +rule test-bsl-run ( test-name : sources * : requirements * : libs * ) { local tests ; tests += [ run-invoke $(test-name) : # sources - $(test-name).cpp $(sources).cpp + $(test-name).cpp $(sources).cpp $(libs) : $(requirements) ] ;