diff options
author | niklas <niklas@niklashalle.net> | 2020-08-24 08:17:08 +0200 |
---|---|---|
committer | niklas <niklas@niklashalle.net> | 2020-08-24 08:17:08 +0200 |
commit | 4065b17de8bd2a7ebe4c600c5b4bce665a3fa520 (patch) | |
tree | 1934db5473c288665549e6140e9905d9dbd21268 | |
parent | 414f5ab444d38d4c9605d16597450282b4699896 (diff) | |
download | crow-4065b17de8bd2a7ebe4c600c5b4bce665a3fa520.tar.gz crow-4065b17de8bd2a7ebe4c600c5b4bce665a3fa520.zip |
-rw-r--r-- | include/crow/socket_adaptors.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/crow/socket_adaptors.h b/include/crow/socket_adaptors.h index eda4b4c..1fdad5b 100644 --- a/include/crow/socket_adaptors.h +++ b/include/crow/socket_adaptors.h @@ -4,6 +4,13 @@ #include <boost/asio/ssl.hpp> #endif #include "crow/settings.h" + +#if BOOST_VERSION >= 107000 +# define SOCKET_CONTEXT(sock) (boost::asio::io_context&) sock.get_executor().context() +#else +# define SOCKET_CONTEXT(sock) sock.get_io_service() +#endif + namespace crow { using namespace boost; @@ -19,7 +26,7 @@ namespace crow boost::asio::io_service& get_io_service() { - return (boost::asio::io_context&) socket_.get_executor().context(); + return SOCKET_CONTEXT(socket_); } tcp::socket& raw_socket() |