From: Bartłomiej Piotrowski Date: Sat, 30 Dec 2017 13:40:24 +0000 (+0100) Subject: asiolink: fix build with boost 1.66 X-Git-Tag: trac5495_base^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F60%2Fhead;p=thirdparty%2Fkea.git asiolink: fix build with boost 1.66 - use native_handle() for getting native socket type - use io_context instead of io_service --- diff --git a/src/lib/asiolink/io_acceptor.h b/src/lib/asiolink/io_acceptor.h index c493d3427e..913a3280b2 100644 --- a/src/lib/asiolink/io_acceptor.h +++ b/src/lib/asiolink/io_acceptor.h @@ -47,7 +47,11 @@ public: /// @brief Returns file descriptor of the underlying socket. virtual int getNative() const { +#if BOOST_VERSION < 106600 return (acceptor_->native()); +#else + return (acceptor_->native_handle()); +#endif } /// @brief Opens acceptor socket given the endpoint. diff --git a/src/lib/asiolink/io_service.h b/src/lib/asiolink/io_service.h index e9e402d114..e0832b2c04 100644 --- a/src/lib/asiolink/io_service.h +++ b/src/lib/asiolink/io_service.h @@ -11,7 +11,12 @@ namespace boost { namespace asio { +#if BOOST_VERSION < 106600 class io_service; +#else + class io_context; + typedef io_context io_service; +#endif } } diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h index adf74d1f0f..83b8264c85 100644 --- a/src/lib/asiolink/tcp_socket.h +++ b/src/lib/asiolink/tcp_socket.h @@ -75,7 +75,11 @@ public: /// \brief Return file descriptor of underlying socket virtual int getNative() const { +#if BOOST_VERSION < 106600 return (socket_.native()); +#else + return (socket_.native_handle()); +#endif } /// \brief Return protocol of socket diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h index 07ba44743e..5b040cfe1b 100644 --- a/src/lib/asiolink/udp_socket.h +++ b/src/lib/asiolink/udp_socket.h @@ -61,7 +61,11 @@ public: /// \brief Return file descriptor of underlying socket virtual int getNative() const { +#if BOOST_VERSION < 106600 return (socket_.native()); +#else + return (socket_.native_handle()); +#endif } /// \brief Return protocol of socket diff --git a/src/lib/asiolink/unix_domain_socket.cc b/src/lib/asiolink/unix_domain_socket.cc index f17ec2e8f7..d1ad9ec30c 100644 --- a/src/lib/asiolink/unix_domain_socket.cc +++ b/src/lib/asiolink/unix_domain_socket.cc @@ -287,7 +287,11 @@ UnixDomainSocket::UnixDomainSocket(IOService& io_service) int UnixDomainSocket::getNative() const { +#if BOOST_VERSION < 106600 return (impl_->socket_.native()); +#else + return (impl_->socket_.native_handle()); +#endif } int