diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index c909ac5f7..da853e1f2 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -21,6 +21,7 @@ EXTRA_DIST = \ src/module.cpp \ src/optional.hpp \ src/peer_info.cpp \ + src/boost_python.hpp \ src/session.cpp \ src/session_settings.cpp \ src/string.cpp \ diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index 7a3f3223d..5d1dc623e 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include #include #include // for piece_block diff --git a/bindings/python/src/big_number.cpp b/bindings/python/src/big_number.cpp index 80d357d20..10e896de8 100644 --- a/bindings/python/src/big_number.cpp +++ b/bindings/python/src/big_number.cpp @@ -3,7 +3,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include "boost_python.hpp" #include "bytes.hpp" long get_hash(boost::python::object o) diff --git a/bindings/python/src/boost_python.hpp b/bindings/python/src/boost_python.hpp new file mode 100644 index 000000000..12c1f3ea2 --- /dev/null +++ b/bindings/python/src/boost_python.hpp @@ -0,0 +1,13 @@ +// Copyright Daniel Wallin 2006. Use, modification and distribution is +// subject to the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_PYTHON_HPP +#define BOOST_PYTHON_HPP + +#include +#include +#include + +#endif + diff --git a/bindings/python/src/bytes.hpp b/bindings/python/src/bytes.hpp index d2690a62d..02943b92a 100644 --- a/bindings/python/src/bytes.hpp +++ b/bindings/python/src/bytes.hpp @@ -9,16 +9,16 @@ struct bytes { - bytes(char const* s, int len): arr(s, len) {} - bytes(std::string const& s): arr(s) {} + bytes(char const* s, int len): arr(s, len) {} + bytes(std::string const& s): arr(s) {} #if __cplusplus >= 201103L - bytes(std::string&& s): arr(std::move(s)) {} - bytes(bytes const&) = default; - bytes(bytes&&) = default; - bytes& operator=(bytes&&) = default; + bytes(std::string&& s): arr(std::move(s)) {} + bytes(bytes const&) = default; + bytes(bytes&&) = default; + bytes& operator=(bytes&&) = default; #endif - bytes() {} - std::string arr; + bytes() {} + std::string arr; }; #endif diff --git a/bindings/python/src/converters.cpp b/bindings/python/src/converters.cpp index cae84be75..b7981ce7c 100644 --- a/bindings/python/src/converters.cpp +++ b/bindings/python/src/converters.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" using namespace boost::python; diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp index d8e99bed8..95f512d18 100644 --- a/bindings/python/src/create_torrent.cpp +++ b/bindings/python/src/create_torrent.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include #include #include "libtorrent/torrent_info.hpp" diff --git a/bindings/python/src/datetime.cpp b/bindings/python/src/datetime.cpp index 220607bfe..f1e91d702 100644 --- a/bindings/python/src/datetime.cpp +++ b/bindings/python/src/datetime.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include #include "optional.hpp" #include diff --git a/bindings/python/src/entry.cpp b/bindings/python/src/entry.cpp index 3d84bec79..bced76d65 100644 --- a/bindings/python/src/entry.cpp +++ b/bindings/python/src/entry.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include #include "bytes.hpp" diff --git a/bindings/python/src/error_code.cpp b/bindings/python/src/error_code.cpp index ff5e74cb0..caea76ba9 100644 --- a/bindings/python/src/error_code.cpp +++ b/bindings/python/src/error_code.cpp @@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include +#include "boost_python.hpp" using namespace boost::python; using namespace libtorrent; diff --git a/bindings/python/src/fingerprint.cpp b/bindings/python/src/fingerprint.cpp index f0346176f..27215fac4 100644 --- a/bindings/python/src/fingerprint.cpp +++ b/bindings/python/src/fingerprint.cpp @@ -3,12 +3,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include - -#include - -#include - -#include +#include "boost_python.hpp" void bind_fingerprint() { diff --git a/bindings/python/src/ip_filter.cpp b/bindings/python/src/ip_filter.cpp index 74ef2e89e..8fea1888b 100644 --- a/bindings/python/src/ip_filter.cpp +++ b/bindings/python/src/ip_filter.cpp @@ -3,7 +3,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include "boost_python.hpp" #include "gil.hpp" using namespace boost::python; diff --git a/bindings/python/src/magnet_uri.cpp b/bindings/python/src/magnet_uri.cpp index 132e613d3..f3f087fc3 100644 --- a/bindings/python/src/magnet_uri.cpp +++ b/bindings/python/src/magnet_uri.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt -#include +#include "boost_python.hpp" #include #include #include @@ -17,23 +17,23 @@ extern void dict_to_add_torrent_params(dict params, add_torrent_params& p); namespace { #ifndef TORRENT_NO_DEPRECATE - torrent_handle _add_magnet_uri(lt::session& s, std::string uri, dict params) - { - add_torrent_params p; + torrent_handle _add_magnet_uri(lt::session& s, std::string uri, dict params) + { + add_torrent_params p; - dict_to_add_torrent_params(params, p); + dict_to_add_torrent_params(params, p); - allow_threading_guard guard; + allow_threading_guard guard; - p.url = uri; + p.url = uri; #ifndef BOOST_NO_EXCEPTIONS - return s.add_torrent(p); + return s.add_torrent(p); #else - error_code ec; - return s.add_torrent(p, ec); + error_code ec; + return s.add_torrent(p, ec); #endif - } + } #endif dict parse_magnet_uri_wrap(std::string const& uri) @@ -76,10 +76,10 @@ namespace { void bind_magnet_uri() { #ifndef TORRENT_NO_DEPRECATE - def("add_magnet_uri", &_add_magnet_uri); + def("add_magnet_uri", &_add_magnet_uri); #endif - def("make_magnet_uri", make_magnet_uri0); - def("make_magnet_uri", make_magnet_uri1); - def("parse_magnet_uri", parse_magnet_uri_wrap); + def("make_magnet_uri", make_magnet_uri0); + def("make_magnet_uri", make_magnet_uri1); + def("parse_magnet_uri", parse_magnet_uri_wrap); } diff --git a/bindings/python/src/optional.hpp b/bindings/python/src/optional.hpp index 63138cc68..2477924d0 100644 --- a/bindings/python/src/optional.hpp +++ b/bindings/python/src/optional.hpp @@ -5,7 +5,7 @@ #ifndef OPTIONAL_070108_HPP # define OPTIONAL_070108_HPP -# include +# include "boost_python.hpp" # include template diff --git a/bindings/python/src/peer_info.cpp b/bindings/python/src/peer_info.cpp index c72b58166..3fd7fd045 100644 --- a/bindings/python/src/peer_info.cpp +++ b/bindings/python/src/peer_info.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "boost_python.hpp" #include using namespace boost::python; diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 34340216b..918be8763 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -28,7 +28,7 @@ #include "libtorrent/aux_/disable_warnings_push.hpp" -#include +#include "boost_python.hpp" #include "libtorrent/aux_/disable_warnings_pop.hpp" diff --git a/bindings/python/src/session_settings.cpp b/bindings/python/src/session_settings.cpp index b17170c07..f47418327 100644 --- a/bindings/python/src/session_settings.cpp +++ b/bindings/python/src/session_settings.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include using namespace boost::python; diff --git a/bindings/python/src/string.cpp b/bindings/python/src/string.cpp index cf3355489..6784f801c 100644 --- a/bindings/python/src/string.cpp +++ b/bindings/python/src/string.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include using namespace boost::python; diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index 06464a8c2..59a269de3 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include #include #include diff --git a/bindings/python/src/torrent_info.cpp b/bindings/python/src/torrent_info.cpp index fcdec046d..0ca2dd018 100644 --- a/bindings/python/src/torrent_info.cpp +++ b/bindings/python/src/torrent_info.cpp @@ -4,7 +4,7 @@ #include "libtorrent/aux_/disable_warnings_push.hpp" -#include +#include "boost_python.hpp" #include #include "libtorrent/aux_/disable_warnings_pop.hpp" diff --git a/bindings/python/src/torrent_status.cpp b/bindings/python/src/torrent_status.cpp index b6e0228a2..fc74eddfa 100644 --- a/bindings/python/src/torrent_status.cpp +++ b/bindings/python/src/torrent_status.cpp @@ -2,7 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include "boost_python.hpp" #include #include #include diff --git a/bindings/python/src/utility.cpp b/bindings/python/src/utility.cpp index b9c00b5fa..a357d7fd4 100644 --- a/bindings/python/src/utility.cpp +++ b/bindings/python/src/utility.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "boost_python.hpp" #include "bytes.hpp" using namespace boost::python; diff --git a/bindings/python/src/version.cpp b/bindings/python/src/version.cpp index a7045d020..e6234cb0e 100644 --- a/bindings/python/src/version.cpp +++ b/bindings/python/src/version.cpp @@ -3,7 +3,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include "boost_python.hpp" using namespace boost::python; using libtorrent::version; diff --git a/include/libtorrent/bandwidth_limit.hpp b/include/libtorrent/bandwidth_limit.hpp index cc21d715b..3c7a3f8fe 100644 --- a/include/libtorrent/bandwidth_limit.hpp +++ b/include/libtorrent/bandwidth_limit.hpp @@ -33,9 +33,13 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_BANDWIDTH_CHANNEL_HPP_INCLUDED #define TORRENT_BANDWIDTH_CHANNEL_HPP_INCLUDED +#include "libtorrent/aux_/disable_warnings_push.hpp" + #include #include +#include "libtorrent/aux_/disable_warnings_pop.hpp" + #include "libtorrent/assert.hpp" namespace libtorrent { diff --git a/include/libtorrent/hasher.hpp b/include/libtorrent/hasher.hpp index 9bdbac22c..2e6a6a5eb 100644 --- a/include/libtorrent/hasher.hpp +++ b/include/libtorrent/hasher.hpp @@ -33,12 +33,16 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_HASHER_HPP_INCLUDED #define TORRENT_HASHER_HPP_INCLUDED -#include - #include "libtorrent/peer_id.hpp" #include "libtorrent/config.hpp" #include "libtorrent/assert.hpp" +#include "libtorrent/aux_/disable_warnings_push.hpp" + +#include + +#include "libtorrent/aux_/disable_warnings_pop.hpp" + #ifdef TORRENT_USE_GCRYPT #include diff --git a/include/libtorrent/io.hpp b/include/libtorrent/io.hpp index 8d6aaa31b..83f9dc31f 100644 --- a/include/libtorrent/io.hpp +++ b/include/libtorrent/io.hpp @@ -33,7 +33,10 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_IO_HPP_INCLUDED #define TORRENT_IO_HPP_INCLUDED +#include "libtorrent/aux_/disable_warnings_push.hpp" #include +#include "libtorrent/aux_/disable_warnings_pop.hpp" + #include #include // for copy #include // for memcpy diff --git a/src/bandwidth_queue_entry.cpp b/src/bandwidth_queue_entry.cpp index 718de558f..5086bddfb 100644 --- a/src/bandwidth_queue_entry.cpp +++ b/src/bandwidth_queue_entry.cpp @@ -30,7 +30,12 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "libtorrent/aux_/disable_warnings_push.hpp" + #include + +#include "libtorrent/aux_/disable_warnings_pop.hpp" + #include "libtorrent/bandwidth_queue_entry.hpp" #include #include