From 236e0e76992ef7da7b2a7139655f77c31f376100 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Wed, 11 Apr 2018 20:18:01 -0700 Subject: [PATCH 1/4] pass default constructed boost::function instead of NULL Clang 6 defines NULL as nullptr which breaks implicit construction of boost::function from NULL. --- src/kademlia/dht_tracker.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp index 1831fbe6f..4048e47ff 100644 --- a/src/kademlia/dht_tracker.cpp +++ b/src/kademlia/dht_tracker.cpp @@ -224,7 +224,10 @@ namespace libtorrent { namespace dht void dht_tracker::get_peers(sha1_hash const& ih , boost::function const&)> f) { - m_dht.get_peers(ih, f, NULL, false); + // TODO: Use `{}` instead of spelling out the whole function type when this is merged to master + m_dht.get_peers(ih, f + , boost::function > const&)>() + , false); } void dht_tracker::announce(sha1_hash const& ih, int listen_port, int flags From 64d6b4900448097b0157abb328621dd211e2947d Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 11 Apr 2018 13:48:42 +0200 Subject: [PATCH 2/4] fix boost-1.67 build --- include/libtorrent/ip_filter.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/ip_filter.hpp b/include/libtorrent/ip_filter.hpp index 4e47b39a1..445562444 100644 --- a/include/libtorrent/ip_filter.hpp +++ b/include/libtorrent/ip_filter.hpp @@ -41,10 +41,16 @@ POSSIBILITY OF SUCH DAMAGE. #include #include -#include #include #include +#include +#if BOOST_VERSION >= 106700 +#include +#else +#include +#endif + #include "libtorrent/aux_/disable_warnings_pop.hpp" #include "libtorrent/address.hpp" From b3faba329d9deba7bf0efba43200fb237756fbd9 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Thu, 12 Apr 2018 21:05:02 -0700 Subject: [PATCH 3/4] create dummy alias for boost_python3 when python3 is unavailable Versions of boost as recent as 1.63 do not create a stub alias for python3 which causes build failures if no version of python3 is configured. Duplicate that behavior so that building works even on older versions of boost. --- bindings/python/Jamfile | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index 9539eb5cf..a93325762 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 { From 9cd0ae67e74a507c1b9ff9c057ee97dda38ccb81 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 13 Apr 2018 08:42:39 +0200 Subject: [PATCH 4/4] another boost-1.67 build fix --- src/kademlia/routing_table.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index a23500b69..dfc350093 100644 --- a/src/kademlia/routing_table.cpp +++ b/src/kademlia/routing_table.cpp @@ -54,6 +54,13 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#include +#if BOOST_VERSION >= 106700 +#include +#else +#include +#endif + #include "libtorrent/aux_/disable_warnings_pop.hpp" using boost::uint8_t;