diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index caf855513..da3ff2045 100644 --- a/bindings/python/Jamfile +++ b/bindings/python/Jamfile @@ -1,4 +1,5 @@ import python ; +import feature ; import feature : feature ; import project ; import targets ; @@ -27,11 +28,33 @@ if $(LIBTORRENT_PYTHON_INTERPRETER) using python : : "$(LIBTORRENT_PYTHON_INTERPRETER)" : : : on ; } +# copied from boost 1.63's boost python jamfile +rule find-py3-version +{ + local versions = [ feature.values python ] ; + local py3ver ; + for local v in $(versions) + { + if $(v) >= 3.0 + { + py3ver = $(v) ; + } + } + return $(py3ver) ; +} + if $(BOOST_ROOT) { use-project /boost : $(BOOST_ROOT) ; alias boost_python : /boost/python//boost_python : : : $(BOOST_ROOT) ; - alias boost_python3 : /boost/python//boost_python3 : : : $(BOOST_ROOT) ; + if [ find-py3-version ] + { + alias boost_python3 : /boost/python//boost_python3 : : : $(BOOST_ROOT) ; + } + else + { + alias boost_python3 ; + } } else { diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp index 41812381e..434131956 100644 --- a/src/kademlia/dht_tracker.cpp +++ b/src/kademlia/dht_tracker.cpp @@ -320,9 +320,8 @@ namespace libtorrent { namespace dht { void dht_tracker::get_peers(sha1_hash const& ih , std::function const&)> f) { - std::function> const&)> empty; for (auto& n : m_nodes) - n.second.dht.get_peers(ih, f, empty, false); + n.second.dht.get_peers(ih, f, {}, false); } void dht_tracker::announce(sha1_hash const& ih, int listen_port, int flags diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index 30396806f..72fc8c4b1 100644 --- a/src/kademlia/routing_table.cpp +++ b/src/kademlia/routing_table.cpp @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include -#include // std::distance() +#include // std::distance(), std::next #include // std::copy, std::remove_copy_if #include #include