merged fixes from RC_0_16
This commit is contained in:
@@ -311,11 +311,25 @@ void connect_peer(torrent_handle& th, tuple ip, int source)
|
||||
}
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
#if BOOST_VERSION > 104200
|
||||
|
||||
boost::intrusive_ptr<const torrent_info> get_torrent_info(torrent_handle const& h)
|
||||
{
|
||||
return boost::intrusive_ptr<const torrent_info>(&h.get_torrent_info());
|
||||
return boost::intrusive_ptr<const torrent_info>(&h.get_torrent_info());
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
boost::intrusive_ptr<torrent_info> get_torrent_info(torrent_handle const& h)
|
||||
{
|
||||
// I can't figure out how to expose intrusive_ptr<const torrent_info>
|
||||
// as well as supporting mutable instances. So, this hack is better
|
||||
// than compilation errors. It seems to work on newer versions of boost though
|
||||
return boost::intrusive_ptr<torrent_info>(const_cast<torrent_info*>(&h.get_torrent_info()));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void set_peer_upload_limit(torrent_handle& th, tuple const& ip, int limit)
|
||||
{
|
||||
th.set_peer_upload_limit(tuple_to_endpoint(ip), limit);
|
||||
|
@@ -285,7 +285,9 @@ void bind_torrent_info()
|
||||
.value("source_tex", announce_entry::source_tex)
|
||||
;
|
||||
|
||||
#if BOOST_VERSION > 104200
|
||||
implicitly_convertible<boost::intrusive_ptr<torrent_info>, boost::intrusive_ptr<const torrent_info> >();
|
||||
boost::python::register_ptr_to_python<boost::intrusive_ptr<const torrent_info> >();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user