From 76a0efa8ee3ea5bb466b81d84357d2fd76920cbd Mon Sep 17 00:00:00 2001 From: stoffu Date: Mon, 24 Jun 2019 14:04:58 +0900 Subject: [PATCH] crow: fix for Boost 1.70 --- ext/crow/crow/socket_adaptors.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/crow/crow/socket_adaptors.h b/ext/crow/crow/socket_adaptors.h index eebd50f..06d4baf 100644 --- a/ext/crow/crow/socket_adaptors.h +++ b/ext/crow/crow/socket_adaptors.h @@ -4,6 +4,11 @@ #include #endif #include "crow/settings.h" +#if BOOST_VERSION >= 107000 +#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context()) +#else +#define GET_IO_SERVICE(s) ((s).get_io_service()) +#endif namespace crow { using namespace boost; @@ -19,7 +24,7 @@ namespace crow boost::asio::io_service& get_io_service() { - return socket_.get_io_service(); + return GET_IO_SERVICE(socket_); } tcp::socket& raw_socket() @@ -94,7 +99,7 @@ namespace crow boost::asio::io_service& get_io_service() { - return raw_socket().get_io_service(); + return GET_IO_SERVICE(raw_socket()); } template