Skip to content

Commit

Permalink
Merge pull request #1 from moneroexamples/fix_boost_170
Browse files Browse the repository at this point in the history
fixes problem with boot 1.70
  • Loading branch information
mrozigor authored Nov 5, 2019
2 parents 741ba25 + c95f684 commit 1a92344
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/crow/socket_adaptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include <boost/asio/ssl.hpp>
#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;
Expand All @@ -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()
Expand Down Expand Up @@ -96,7 +101,7 @@ namespace crow

boost::asio::io_service& get_io_service()
{
return raw_socket().get_io_service();
return GET_IO_SERVICE(raw_socket());
}

template <typename F>
Expand Down

0 comments on commit 1a92344

Please sign in to comment.