mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-09-17 06:31:22 +00:00
Fix building of nav_listener for Boost>=1.66
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user