Fix building of nav_listener for Boost>=1.66

This commit is contained in:
Carles Fernandez
2026-01-09 09:48:34 +01:00
parent 6f1d9abd5c
commit 3cd0952e0c
2 changed files with 14 additions and 1 deletions
+7
View File
@@ -73,6 +73,13 @@ target_include_directories(navmsg_lib
${NAVLISTENER_BINARY_DIR}
)
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
target_compile_definitions(navmsg_lib
PUBLIC
-DUSE_BOOST_ASIO_IO_CONTEXT=1
)
endif()
add_executable(nav_msg_listener ${NAVLISTENER_SOURCE_DIR}/main.cc)
target_link_libraries(nav_msg_listener PUBLIC navmsg_lib)
+7 -1
View File
@@ -19,6 +19,12 @@
#include "nav_message.pb.h"
#include <boost/asio.hpp>
#if USE_BOOST_ASIO_IO_CONTEXT
using b_io_context = boost::asio::io_context;
#else
using b_io_context = boost::asio::io_service;
#endif
class Nav_Msg_Udp_Listener
{
public:
@@ -27,7 +33,7 @@ public:
bool receive_and_parse_nav_message(gnss_sdr::navMsg &message);
private:
boost::asio::io_service io_service;
b_io_context io_service;
boost::asio::ip::udp::socket socket;
boost::system::error_code error;
boost::asio::ip::udp::endpoint endpoint;