diff --git a/include/libtorrent/chained_buffer.hpp b/include/libtorrent/chained_buffer.hpp index 3899e7366..22eba1e97 100644 --- a/include/libtorrent/chained_buffer.hpp +++ b/include/libtorrent/chained_buffer.hpp @@ -34,14 +34,19 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_CHAINED_BUFFER_HPP_INCLUDED #include +#if BOOST_VERSION < 103500 +#include +#else #include +#endif #include #include namespace libtorrent { +#if BOOST_VERSION >= 103500 namespace asio = boost::asio; - +#endif struct chained_buffer { chained_buffer(): m_bytes(0), m_capacity(0) {} diff --git a/include/libtorrent/kademlia/msg.hpp b/include/libtorrent/kademlia/msg.hpp index 4255bfa72..00db7305c 100644 --- a/include/libtorrent/kademlia/msg.hpp +++ b/include/libtorrent/kademlia/msg.hpp @@ -36,7 +36,11 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include "libtorrent/entry.hpp" +#if BOOST_VERSION < 103500 +#include +#else #include +#endif namespace libtorrent { namespace dht { diff --git a/include/libtorrent/proxy_base.hpp b/include/libtorrent/proxy_base.hpp index 1876b6d68..873e84190 100644 --- a/include/libtorrent/proxy_base.hpp +++ b/include/libtorrent/proxy_base.hpp @@ -38,9 +38,13 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include +#if BOOST_VERSION < 103500 +#include +#include +#else #include #include - +#endif namespace libtorrent { diff --git a/include/libtorrent/socket.hpp b/include/libtorrent/socket.hpp index 8b4d103c0..0bca27da5 100755 --- a/include/libtorrent/socket.hpp +++ b/include/libtorrent/socket.hpp @@ -45,6 +45,16 @@ POSSIBILITY OF SUCH DAMAGE. #define Protocol Protocol_ #endif +#if BOOST_VERSION < 103500 +#include +#include +#include +#include +#include +#include +#include +#include +#else #include #include #include @@ -53,7 +63,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include +#endif #ifdef __OBJC__ #undef Protocol @@ -69,22 +79,24 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { -/* - namespace asio = boost::asio; +#if BOOST_VERSION < 103500 + using asio::ip::tcp; + using asio::ip::udp; + using asio::async_write; + using asio::async_read; - using boost::asio::ipv4::tcp; - using boost::asio::ipv4::address; - using boost::asio::stream_socket; - using boost::asio::datagram_socket; - using boost::asio::socket_acceptor; - using boost::asio::io_service; - using boost::asio::ipv4::host_resolver; - using boost::asio::async_write; - using boost::asio::ipv4::host; - using boost::asio::deadline_timer; -*/ -// namespace asio = ::asio; + typedef asio::ip::tcp::socket stream_socket; + typedef asio::ip::address address; + typedef asio::ip::address_v4 address_v4; + typedef asio::ip::address_v6 address_v6; + typedef asio::ip::udp::socket datagram_socket; + typedef asio::ip::tcp::acceptor socket_acceptor; + typedef asio::io_service io_service; + typedef asio::error_code error_code; + namespace asio = ::asio; + typedef asio::basic_deadline_timer deadline_timer; +#else using boost::system::error_code; using boost::asio::ip::tcp; using boost::asio::ip::udp; @@ -100,8 +112,8 @@ namespace libtorrent typedef boost::asio::io_service io_service; namespace asio = boost::asio; - typedef boost::asio::basic_deadline_timer deadline_timer; +#endif inline std::ostream& print_address(std::ostream& os, address const& addr) { diff --git a/include/libtorrent/ssl_stream.hpp b/include/libtorrent/ssl_stream.hpp index dfadba45c..363c819f6 100644 --- a/include/libtorrent/ssl_stream.hpp +++ b/include/libtorrent/ssl_stream.hpp @@ -34,8 +34,11 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_SSL_STREAM_HPP_INCLUDED #include "libtorrent/socket.hpp" +#if BOOST_VERSION < 103500 +#include +#else #include - +#endif // openssl seems to believe it owns // this name in every single scope #undef set_key diff --git a/include/libtorrent/time.hpp b/include/libtorrent/time.hpp index b67737bdd..87d9340b8 100644 --- a/include/libtorrent/time.hpp +++ b/include/libtorrent/time.hpp @@ -86,7 +86,11 @@ namespace libtorrent #else +#if BOOST_VERSION < 103500 +#include +#else #include +#endif #include #include "libtorrent/assert.hpp" @@ -152,7 +156,10 @@ namespace libtorrent } // asio time_traits -namespace boost { namespace asio +#if BOOST_VERSION < 103500 +namespace boost { +#endif +namespace asio { template<> struct time_traits @@ -171,7 +178,10 @@ namespace boost { namespace asio duration_type d) { return boost::posix_time::microseconds(libtorrent::total_microseconds(d)); } }; -} } +} +#if BOOST_VERSION < 103500 +} +#endif #if defined(__MACH__) diff --git a/include/libtorrent/variant_stream.hpp b/include/libtorrent/variant_stream.hpp index f641cfc08..3551f5c9e 100644 --- a/include/libtorrent/variant_stream.hpp +++ b/include/libtorrent/variant_stream.hpp @@ -21,7 +21,11 @@ # include # include +#if BOOST_VERSION < 103500 +#include +#else #include +#endif # define NETWORK_VARIANT_STREAM_LIMIT 5 diff --git a/src/broadcast_socket.cpp b/src/broadcast_socket.cpp index 243031c84..2a087ef79 100644 --- a/src/broadcast_socket.cpp +++ b/src/broadcast_socket.cpp @@ -30,8 +30,14 @@ POSSIBILITY OF SUCH DAMAGE. */ +#if BOOST_VERSION < 103500 +#include +#include +#else #include #include +#endif + #include #include "libtorrent/socket.hpp" diff --git a/src/enum_net.cpp b/src/enum_net.cpp index 4328a4574..eb5a9eeef 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -35,8 +35,11 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "libtorrent/enum_net.hpp" #include "libtorrent/broadcast_socket.hpp" +#if BOOST_VERSION < 103500 +#include +#else #include - +#endif #if defined TORRENT_BSD #include diff --git a/src/lsd.cpp b/src/lsd.cpp index 6479bb1c4..2d4e8b7da 100644 --- a/src/lsd.cpp +++ b/src/lsd.cpp @@ -40,8 +40,13 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#if BOOST_VERSION < 103500 +#include +#include +#else #include #include +#endif #include #include #include diff --git a/src/mapped_storage.cpp b/src/mapped_storage.cpp index 13656663e..f0c4d1b8b 100644 --- a/src/mapped_storage.cpp +++ b/src/mapped_storage.cpp @@ -47,7 +47,10 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include +#if BOOST_VERSION >= 103500 #include +#endif + #include #ifdef _MSC_VER @@ -60,7 +63,9 @@ using boost::iostreams::mapped_file_params; namespace libtorrent { namespace fs = boost::filesystem; +#if BOOST_VERSION >= 103500 using boost::system::error_code; +#endif struct mapped_file_pool { @@ -199,7 +204,11 @@ namespace libtorrent size_type start = (offset / view_size) * view_size; TORRENT_ASSERT(start + view_size >= offset + length); +#if BOOST_VERSION < 103500 + fs::system_error_type ec; +#else error_code ec; +#endif fs::file_status st = fs::status(p, ec); m_files.push_back(file_entry()); diff --git a/src/natpmp.cpp b/src/natpmp.cpp index 945a407ab..56f109761 100644 --- a/src/natpmp.cpp +++ b/src/natpmp.cpp @@ -33,7 +33,11 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/pch.hpp" #include +#if BOOST_VERSION < 103500 +#include +#else #include +#endif #include "libtorrent/natpmp.hpp" #include "libtorrent/io.hpp" diff --git a/src/udp_socket.cpp b/src/udp_socket.cpp index a29c34224..78091116a 100644 --- a/src/udp_socket.cpp +++ b/src/udp_socket.cpp @@ -4,7 +4,11 @@ #include #include #include +#if BOOST_VERSION < 103500 +#include +#else #include +#endif using namespace libtorrent; diff --git a/src/upnp.cpp b/src/upnp.cpp index 05e667fc6..b7e05963b 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -42,8 +42,13 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#if BOOST_VERSION < 103500 +#include +#include +#else #include #include +#endif #include #include