Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket_pdu_impl.cc: fix build with boost 1.70.0 #2451

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion gr-blocks/lib/socket_pdu_impl.cc
Expand Up @@ -29,6 +29,12 @@
#include <gnuradio/io_signature.h>
#include <gnuradio/blocks/pdu.h>

#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s)->get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s)->get_io_service())
#endif

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended in boostorg/asio@59066d8#commitcomment-33184421
The 1.70 cast is potentially unsafe


namespace gr {
namespace blocks {

Expand Down Expand Up @@ -165,7 +171,7 @@ namespace gr {
void
socket_pdu_impl::start_tcp_accept()
{
tcp_connection::sptr new_connection = tcp_connection::make(d_acceptor_tcp->get_io_service(), d_rxbuf.size(), d_tcp_no_delay);
tcp_connection::sptr new_connection = tcp_connection::make(GET_IO_SERVICE(d_acceptor_tcp), d_rxbuf.size(), d_tcp_no_delay);

d_acceptor_tcp->async_accept(new_connection->socket(),
boost::bind(&socket_pdu_impl::handle_tcp_accept, this,
Expand Down