From 7e748956e618050a4c7ed13c684f1112ca4d2645 Mon Sep 17 00:00:00 2001 From: Tim Niederhausen Date: Tue, 3 Oct 2017 22:11:42 +0200 Subject: [PATCH] Provide a default ip_change_notifier implementation Right now, compiling fails if there's no ip_change_notifier for the current platform. --- src/ip_notifier.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ip_notifier.cpp b/src/ip_notifier.cpp index bdc8b2dfa..eb7e2081e 100644 --- a/src/ip_notifier.cpp +++ b/src/ip_notifier.cpp @@ -376,6 +376,23 @@ private: OVERLAPPED m_ovl = {}; boost::asio::windows::object_handle m_hnd; }; +#else +struct ip_change_notifier_impl final : ip_change_notifier +{ + explicit ip_change_notifier_impl(io_service& ios) + : m_ios(ios) {} + + void async_wait(std::function cb) override + { + m_ios.post([cb]() + { cb(make_error_code(boost::system::errc::not_supported)); }); + } + + void cancel() override {} + +private: + io_service& m_ios; +}; #endif } // anonymous namespace