Skip to content

Commit

Permalink
Fixed 3Hren#186: Cannot compile with recent boost (clang/gcc)
Browse files Browse the repository at this point in the history
With boost version 1.66.0 the template parameters of basic_socket were
changed.
  • Loading branch information
Maturin committed Nov 30, 2018
1 parent 7af8b7c commit 8c9144b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sink/socket/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ typedef protocol_type::endpoint endpoint_type;

namespace {

#if BOOST_VERSION >= 106600
template<typename Protocol, typename Iterator>
auto do_connect(boost::asio::basic_socket<Protocol>& s,
#else
template<typename Protocol, typename SocketService, typename Iterator>
auto do_connect(boost::asio::basic_socket<Protocol, SocketService>& s,
#endif
Iterator begin,
Iterator end,
boost::system::error_code& ec) -> Iterator
Expand All @@ -50,8 +55,13 @@ auto do_connect(boost::asio::basic_socket<Protocol, SocketService>& s,
return end;
}

#if BOOST_VERSION >= 106600
template <typename Protocol, typename Iterator>
auto do_connect(boost::asio::basic_socket<Protocol>& s, Iterator begin) -> Iterator {
#else
template <typename Protocol, typename SocketService, typename Iterator>
auto do_connect(boost::asio::basic_socket<Protocol, SocketService>& s, Iterator begin) -> Iterator {
#endif
boost::system::error_code ec;
Iterator end = typename Protocol::resolver::iterator();
Iterator result = do_connect(s, begin, end, ec);
Expand Down
1 change: 1 addition & 0 deletions src/sink/socket/tcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <mutex>

#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>

#include "blackhole/sink.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/sink/socket/udp.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/udp.hpp>

#include "blackhole/sink.hpp"
Expand Down

0 comments on commit 8c9144b

Please sign in to comment.