Ticket #8400: boost-serialization-shared_ptr-no-rtti.patch

File boost-serialization-shared_ptr-no-rtti.patch, 2.5 KB (added by Mika Fischer <mika.fischer@…>, 10 years ago)
  • boost/serialization/detail/shared_count_132.hpp

    diff -ru boost/serialization/detail/shared_count_132.hpp boost/serialization/detail/shared_count_132.hpp
     
    3535#include <functional>       // std::less
    3636#include <exception>        // std::exception
    3737#include <new>              // std::bad_alloc
    38 #include <typeinfo>         // std::type_info in get_deleter
     38#include <boost/detail/sp_typeinfo.hpp> // boost::detail::sp_typeinfo in get_deleter
    3939#include <cstddef>          // std::size_t
    4040
    4141#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
     
    119119        delete this;
    120120    }
    121121
    122     virtual void * get_deleter(std::type_info const & ti) = 0;
     122    virtual void * get_deleter(boost::detail::sp_typeinfo const & ti) = 0;
    123123
    124124    void add_ref_copy()
    125125    {
     
    269269        del(ptr);
    270270    }
    271271
    272     virtual void * get_deleter(std::type_info const & ti)
     272    virtual void * get_deleter(boost::detail::sp_typeinfo const & ti)
    273273    {
    274         return ti == typeid(D)? &del: 0;
     274        return ti == BOOST_SP_TYPEID(D)? &del: 0;
    275275    }
    276276
    277277#if defined(BOOST_SP_USE_STD_ALLOCATOR)
     
    441441        return std::less<sp_counted_base *>()(a.pi_, b.pi_);
    442442    }
    443443
    444     void * get_deleter(std::type_info const & ti) const
     444    void * get_deleter(boost::detail::sp_typeinfo const & ti) const
    445445    {
    446446        return pi_? pi_->get_deleter(ti): 0;
    447447    }
  • boost/serialization/detail/shared_ptr_132.hpp

    diff -ru boost/serialization/detail/shared_ptr_132.hpp boost/serialization/detail/shared_ptr_132.hpp
     
    320320        return pn < rhs.pn;
    321321    }
    322322
    323     void * _internal_get_deleter(std::type_info const & ti) const
     323    void * _internal_get_deleter(boost::detail::sp_typeinfo const & ti) const
    324324    {
    325325        return pn.get_deleter(ti);
    326326    }
     
    454454
    455455template<class D, class T> D * get_deleter(shared_ptr< T > const & p)
    456456{
    457     void const * q = p._internal_get_deleter(typeid(D));
     457    void const * q = p._internal_get_deleter(BOOST_SP_TYPEID(D));
    458458    return const_cast<D *>(static_cast<D const *>(q));
    459459}
    460460
     
    462462
    463463template<class D, class T> D * get_deleter(shared_ptr< T > const & p)
    464464{
    465     return static_cast<D *>(p._internal_get_deleter(typeid(D)));
     465    return static_cast<D *>(p._internal_get_deleter(BOOST_SP_TYPEID(D)));
    466466}
    467467
    468468#endif