fixed python binding build with no deprecated functions

This commit is contained in:
Arvid Norberg 2012-06-14 15:41:39 +00:00
parent b623d952e6
commit 5192d03852
2 changed files with 13 additions and 3 deletions

View File

@ -17,6 +17,7 @@ extern void dict_to_add_torrent_params(dict params
namespace { namespace {
#ifndef TORRENT_NO_DEPRECATE
torrent_handle _add_magnet_uri(session& s, std::string uri, dict params) torrent_handle _add_magnet_uri(session& s, std::string uri, dict params)
{ {
add_torrent_params p; add_torrent_params p;
@ -34,6 +35,7 @@ namespace {
return add_magnet_uri(s, uri, p, ec); return add_magnet_uri(s, uri, p, ec);
#endif #endif
} }
#endif
std::string (*make_magnet_uri0)(torrent_handle const&) = make_magnet_uri; std::string (*make_magnet_uri0)(torrent_handle const&) = make_magnet_uri;
std::string (*make_magnet_uri1)(torrent_info const&) = make_magnet_uri; std::string (*make_magnet_uri1)(torrent_info const&) = make_magnet_uri;
@ -41,7 +43,9 @@ namespace {
void bind_magnet_uri() void bind_magnet_uri()
{ {
#ifndef TORRENT_NO_DEPRECATE
def("add_magnet_uri", &_add_magnet_uri); def("add_magnet_uri", &_add_magnet_uri);
#endif
def("make_magnet_uri", make_magnet_uri0); def("make_magnet_uri", make_magnet_uri0);
def("make_magnet_uri", make_magnet_uri1); def("make_magnet_uri", make_magnet_uri1);
} }

View File

@ -256,6 +256,7 @@ void connect_peer(torrent_handle& th, tuple ip, int source)
th.connect_peer(tuple_to_endpoint(ip), source); th.connect_peer(tuple_to_endpoint(ip), source);
} }
#ifndef TORRENT_NO_DEPRECATE
void set_peer_upload_limit(torrent_handle& th, tuple const& ip, int limit) void set_peer_upload_limit(torrent_handle& th, tuple const& ip, int limit)
{ {
th.set_peer_upload_limit(tuple_to_endpoint(ip), limit); th.set_peer_upload_limit(tuple_to_endpoint(ip), limit);
@ -265,6 +266,7 @@ void set_peer_download_limit(torrent_handle& th, tuple const& ip, int limit)
{ {
th.set_peer_download_limit(tuple_to_endpoint(ip), limit); th.set_peer_download_limit(tuple_to_endpoint(ip), limit);
} }
#endif
void add_piece(torrent_handle& th, int piece, char const *data, int flags) void add_piece(torrent_handle& th, int piece, char const *data, int flags)
{ {
@ -275,7 +277,9 @@ void bind_torrent_handle()
{ {
void (torrent_handle::*force_reannounce0)() const = &torrent_handle::force_reannounce; void (torrent_handle::*force_reannounce0)() const = &torrent_handle::force_reannounce;
#ifndef TORRENT_NO_DEPRECATE
bool (torrent_handle::*super_seeding0)() const = &torrent_handle::super_seeding; bool (torrent_handle::*super_seeding0)() const = &torrent_handle::super_seeding;
#endif
void (torrent_handle::*super_seeding1)(bool) const = &torrent_handle::super_seeding; void (torrent_handle::*super_seeding1)(bool) const = &torrent_handle::super_seeding;
int (torrent_handle::*piece_priority0)(int) const = &torrent_handle::piece_priority; int (torrent_handle::*piece_priority0)(int) const = &torrent_handle::piece_priority;
@ -315,7 +319,6 @@ void bind_torrent_handle()
.def("resume", _(&torrent_handle::resume)) .def("resume", _(&torrent_handle::resume))
.def("clear_error", _(&torrent_handle::clear_error)) .def("clear_error", _(&torrent_handle::clear_error))
.def("set_priority", _(&torrent_handle::set_priority)) .def("set_priority", _(&torrent_handle::set_priority))
.def("super_seeding", super_seeding0)
.def("super_seeding", super_seeding1) .def("super_seeding", super_seeding1)
.def("auto_managed", _(&torrent_handle::auto_managed)) .def("auto_managed", _(&torrent_handle::auto_managed))
@ -331,6 +334,7 @@ void bind_torrent_handle()
#endif #endif
// deprecated // deprecated
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
.def("super_seeding", super_seeding0)
.def("filter_piece", _(&torrent_handle::filter_piece)) .def("filter_piece", _(&torrent_handle::filter_piece))
.def("is_piece_filtered", _(&torrent_handle::is_piece_filtered)) .def("is_piece_filtered", _(&torrent_handle::is_piece_filtered))
.def("write_resume_data", _(&torrent_handle::write_resume_data)) .def("write_resume_data", _(&torrent_handle::write_resume_data))
@ -372,10 +376,12 @@ void bind_torrent_handle()
.def("set_download_limit", _(&torrent_handle::set_download_limit)) .def("set_download_limit", _(&torrent_handle::set_download_limit))
.def("download_limit", _(&torrent_handle::download_limit)) .def("download_limit", _(&torrent_handle::download_limit))
.def("set_sequential_download", _(&torrent_handle::set_sequential_download)) .def("set_sequential_download", _(&torrent_handle::set_sequential_download))
#ifndef TORRENT_NO_DEPRECATE
.def("set_peer_upload_limit", &set_peer_upload_limit) .def("set_peer_upload_limit", &set_peer_upload_limit)
.def("set_peer_download_limit", &set_peer_download_limit) .def("set_peer_download_limit", &set_peer_download_limit)
.def("connect_peer", &connect_peer)
.def("set_ratio", _(&torrent_handle::set_ratio)) .def("set_ratio", _(&torrent_handle::set_ratio))
#endif
.def("connect_peer", &connect_peer)
.def("save_path", _(&torrent_handle::save_path)) .def("save_path", _(&torrent_handle::save_path))
.def("set_max_uploads", _(&torrent_handle::set_max_uploads)) .def("set_max_uploads", _(&torrent_handle::set_max_uploads))
.def("set_max_connections", _(&torrent_handle::set_max_connections)) .def("set_max_connections", _(&torrent_handle::set_max_connections))