Merge pull request #183 from stoffu/boost-1.7

crow: fix for Boost 1.70
master
moneroexamples 6 years ago committed by GitHub
commit 07cc804319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,11 @@
#include <boost/asio/ssl.hpp> #include <boost/asio/ssl.hpp>
#endif #endif
#include "crow/settings.h" #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 namespace crow
{ {
using namespace boost; using namespace boost;
@ -19,7 +24,7 @@ namespace crow
boost::asio::io_service& get_io_service() boost::asio::io_service& get_io_service()
{ {
return socket_.get_io_service(); return GET_IO_SERVICE(socket_);
} }
tcp::socket& raw_socket() tcp::socket& raw_socket()
@ -94,7 +99,7 @@ namespace crow
boost::asio::io_service& get_io_service() boost::asio::io_service& get_io_service()
{ {
return raw_socket().get_io_service(); return GET_IO_SERVICE(raw_socket());
} }
template <typename F> template <typename F>

Loading…
Cancel
Save