From: Thomas Jarosch Date: Sat, 27 Dec 2025 16:36:25 +0000 (+0100) Subject: Fix additional Boost API compatibility issues X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=acd6427eea542c4eca71f88022a22aecaf38c5bf;p=pingcheck Fix additional Boost API compatibility issues - networkinterface.hpp: Replace Socket.native() with Socket.native_handle() for newer Boost versions - icmppinger.cpp: Use boost::function instead of bare function to avoid ambiguity with std::function - tcppinger.cpp: Same fix for boost::function --- diff --git a/src/host/networkinterface.hpp b/src/host/networkinterface.hpp index 364376c..564730b 100644 --- a/src/host/networkinterface.hpp +++ b/src/host/networkinterface.hpp @@ -109,7 +109,7 @@ bool NetworkInterface::bind() BOOST_ASSERT( !Name.empty() ); int ret = ::setsockopt( - Socket.native(), + Socket.native_handle(), SOL_SOCKET, SO_BINDTODEVICE, Name.c_str(), diff --git a/src/icmp/icmppinger.cpp b/src/icmp/icmppinger.cpp index 2415c83..a87a409 100644 --- a/src/icmp/icmppinger.cpp +++ b/src/icmp/icmppinger.cpp @@ -128,7 +128,7 @@ IcmpPinger::~IcmpPinger() void IcmpPinger::ping( const address &destination_ip, const uint16_t /*destination_port*/, // the ICMP protocol does not use ports - function ping_done_callback + boost::function ping_done_callback ) { PingDoneCallback = ping_done_callback; diff --git a/src/main.cpp b/src/main.cpp index 3c015ec..876462b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,7 +55,7 @@ using I2n::Logger::GlobalLogger; // a map from interval (in seconds) to delay (in seconds) typedef std::pair IntervalCountPair; typedef std::map DelayMap; -typedef shared_ptr TimerItem; +typedef boost::shared_ptr TimerItem; const boost::posix_time::time_duration SIGNAL_CHECK_INTERVAL = boost::posix_time::seconds(1); diff --git a/src/tcp/tcppinger.cpp b/src/tcp/tcppinger.cpp index e7a6e95..41fd129 100644 --- a/src/tcp/tcppinger.cpp +++ b/src/tcp/tcppinger.cpp @@ -115,7 +115,7 @@ TcpPinger::~TcpPinger() void TcpPinger::ping( const address &destination_ip, const uint16_t destination_port, - function ping_done_callback + boost::function ping_done_callback ) { BOOST_ASSERT( ( 0 < destination_port ) && ( destination_port < numeric_limits::max() ) ); diff --git a/test/test_dns.cpp b/test/test_dns.cpp index 17495e7..8b35509 100644 --- a/test/test_dns.cpp +++ b/test/test_dns.cpp @@ -197,7 +197,7 @@ struct GlobalFixture // this causes above fixture to be created only once before tests start and // destructed after tests end; however, variables are not accessible in test // cases -BOOST_GLOBAL_FIXTURE( GlobalFixture ) +BOOST_GLOBAL_FIXTURE( GlobalFixture ); // using this as suite-level fixture makes variable Master accessible in all