From 4161659ee0aecba352f459514b6f15fbca4f1f90 Mon Sep 17 00:00:00 2001
From: Huang Rui <vowstar@gmail.com>
Date: Mon, 26 Oct 2020 10:21:43 +0800
Subject: gr-uhd/lib/usrp_block_impl.cc: fix compile error using boost>=1.73
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When using boost>=1.73 and compile with uhd, it always have errors.
Fix the compile error when using uhd and gcc10: error: ‘_1’ was not declared
Bug: https://bugs.gentoo.org/751259

usrp_source_impl.cc: use lambdas instead of boost::bind
usrp_block_impl.cc:use lambdas instead of boost::bind
usrp_block_impl.h: Switch from boost::function to std::function

https://github.com/gnuradio/gnuradio/pull/3441
https://github.com/gnuradio/gnuradio/pull/3887

usrp_source_impl: fix parameter bug of original code

The usrp_block_impl::register_msg_cmd_handler uses cmd_handler_t as
handler type, but it have 3 parameters.
Fix the parameter mismatch bug and change the signature as cmd_handler_t

Signed-off-by: Huang Rui <vowstar@gmail.com>
---
 gr-uhd/lib/usrp_source_impl.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'gr-uhd/lib/usrp_source_impl.cc')

diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index eed04e9787..fa910f1a9f 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -46,7 +46,9 @@ usrp_source_impl::usrp_source_impl(const ::uhd::device_addr_t& device_addr,
     _samp_rate = this->get_samp_rate();
     _samps_per_packet = 1;
     register_msg_cmd_handler(cmd_tag_key(),
-                             boost::bind(&usrp_source_impl::_cmd_handler_tag, this, _1));
+                             [this](const pmt::pmt_t& tag, const int, const pmt::pmt_t&) {
+                                 this->_cmd_handler_tag(tag);
+                             });
 }
 
 usrp_source_impl::~usrp_source_impl() {}
-- 
cgit v1.2.3