From 87f08265bcfc1ea4f6ec8483298c37a732c23e05 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 21 Dec 2013 06:20:16 +0000 Subject: [PATCH] some more fixes around TORRENT_DISABLE_EXTENSIONS --- bindings/python/src/session.cpp | 2 ++ include/libtorrent/extensions/lt_trackers.hpp | 4 ++++ include/libtorrent/extensions/metadata_transfer.hpp | 4 ++++ include/libtorrent/extensions/ut_metadata.hpp | 3 +++ include/libtorrent/extensions/ut_pex.hpp | 4 ++++ test/test_pex.cpp | 6 ++++++ test/test_trackers_extension.cpp | 6 ++++++ 7 files changed, 29 insertions(+) diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 6556bb17c..a81679a66 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -61,6 +61,7 @@ namespace void add_extension(session& s, object const& e) { +#ifndef TORRENT_DISABLE_EXTENSIONS if (!extract(e).check()) return; std::string name = extract(e); @@ -74,6 +75,7 @@ namespace s.add_extension(create_lt_trackers_plugin); else if (name == "metadata_transfer") s.add_extension(create_metadata_plugin); +#endif // TORRENT_DISABLE_EXTENSIONS } #ifndef TORRENT_NO_DEPRECATE diff --git a/include/libtorrent/extensions/lt_trackers.hpp b/include/libtorrent/extensions/lt_trackers.hpp index e4d6f9295..8587ee057 100644 --- a/include/libtorrent/extensions/lt_trackers.hpp +++ b/include/libtorrent/extensions/lt_trackers.hpp @@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_LT_TRACKERS_HPP_INCLUDED #define TORRENT_LT_TRACKERS_HPP_INCLUDED +#ifndef TORRENT_DISABLE_EXTENSIONS + #ifdef _MSC_VER #pragma warning(push, 1) #endif @@ -55,5 +57,7 @@ namespace libtorrent boost::shared_ptr TORRENT_EXPORT create_lt_trackers_plugin(torrent*, void*); } +#endif // TORRENT_DISABLE_EXTENSIONS + #endif // TORRENT_LT_TRACKERS_HPP_INCLUDED diff --git a/include/libtorrent/extensions/metadata_transfer.hpp b/include/libtorrent/extensions/metadata_transfer.hpp index 1af0d9ab2..84f7aa7b7 100644 --- a/include/libtorrent/extensions/metadata_transfer.hpp +++ b/include/libtorrent/extensions/metadata_transfer.hpp @@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_METADATA_TRANSFER_HPP_INCLUDED #define TORRENT_METADATA_TRANSFER_HPP_INCLUDED +#ifndef TORRENT_DISABLE_EXTENSIONS + #ifdef _MSC_VER #pragma warning(push, 1) #endif @@ -61,5 +63,7 @@ namespace libtorrent #endif } +#endif // TORRENT_DISABLE_EXTENSIONS + #endif // TORRENT_METADATA_TRANSFER_HPP_INCLUDED diff --git a/include/libtorrent/extensions/ut_metadata.hpp b/include/libtorrent/extensions/ut_metadata.hpp index e0b0b0750..4daab9b6a 100644 --- a/include/libtorrent/extensions/ut_metadata.hpp +++ b/include/libtorrent/extensions/ut_metadata.hpp @@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_UT_METADATA_HPP_INCLUDED #define TORRENT_UT_METADATA_HPP_INCLUDED +#ifndef TORRENT_DISABLE_EXTENSIONS + #ifdef _MSC_VER #pragma warning(push, 1) #endif @@ -61,5 +63,6 @@ namespace libtorrent TORRENT_EXPORT boost::shared_ptr create_ut_metadata_plugin(torrent*, void*); } +#endif // TORRENT_DISABLE_EXTENSIONS #endif // TORRENT_UT_METADATA_HPP_INCLUDED diff --git a/include/libtorrent/extensions/ut_pex.hpp b/include/libtorrent/extensions/ut_pex.hpp index 256a29094..fc91ef7f2 100644 --- a/include/libtorrent/extensions/ut_pex.hpp +++ b/include/libtorrent/extensions/ut_pex.hpp @@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED #define TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED +#ifndef TORRENT_DISABLE_EXTENSIONS + #ifdef _MSC_VER #pragma warning(push, 1) #endif @@ -60,4 +62,6 @@ namespace libtorrent TORRENT_EXPORT boost::shared_ptr create_ut_pex_plugin(torrent*, void*); } +#endif // TORRENT_DISABLE_EXTENSIONS + #endif // TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED diff --git a/test/test_pex.cpp b/test/test_pex.cpp index 6059ab583..5a70aa5fc 100644 --- a/test/test_pex.cpp +++ b/test/test_pex.cpp @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +#ifndef TORRENT_DISABLE_EXTENSIONS + #include "libtorrent/session.hpp" #include "libtorrent/session_settings.hpp" #include "libtorrent/hasher.hpp" @@ -166,3 +168,7 @@ int test_main() return 0; } +#else +int test_main() { return 0; } +#endif // TORRENT_DISABLE_EXTENSIONS + diff --git a/test/test_trackers_extension.cpp b/test/test_trackers_extension.cpp index 2b140ad45..38547fc0a 100644 --- a/test/test_trackers_extension.cpp +++ b/test/test_trackers_extension.cpp @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +#ifndef TORRENT_DISABLE_EXTENSIONS + #include "libtorrent/session.hpp" #include "libtorrent/hasher.hpp" #include "libtorrent/thread.hpp" @@ -129,3 +131,7 @@ int test_main() return 0; } +#else +int test_main() { return 0; } +#endif // TORRENT_DISABLE_EXTENSIONS +