From cd2dfe0bc2a3157b1b5db3eca04e5a784f1830b3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 6 Jun 2020 14:11:19 +0200 Subject: [PATCH] Fix for Boost 1.73 --- .../signal_source/gnuradio_blocks/CMakeLists.txt | 7 +++++++ .../gnuradio_blocks/rtl_tcp_signal_source_c.cc | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 3a4b47d50..45ab8e9e3 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -103,6 +103,13 @@ if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) ) endif() +if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) + target_compile_definitions(signal_source_gr_blocks + PRIVATE + -DBOOST_173_OR_GREATER=1 + ) +endif() + if(CMAKE_VERSION VERSION_GREATER 3.1) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 9b97034dd..6ad2e2af8 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -133,9 +133,14 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, LOG(INFO) << "Found " << info_.get_type_name() << " tuner."; } - // 6. Start reading +// 6. Start reading +#if BOOST_173_OR_GREATER + boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); +#else boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, _1, _2)); // NOLINT(modernize-avoid-bind) +#endif + boost::thread( #if HAS_GENERIC_LAMBDA