diff --git a/CMakeLists.txt b/CMakeLists.txt index 65a68c4f3..3dbc3c633 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,6 +260,8 @@ endif() if (WIN32) target_link_libraries(torrent-rasterbar wsock32 ws2_32) add_definitions(-D_WIN32_WINNT=0x0600) + # prevent winsock1 to be included + add_definitions(-DWIN32_LEAN_AND_MEAN) if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # multicore compilation endif() diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index c9d1ea467..138c6d18f 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -34,29 +34,6 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_PEER_CONNECTION_HPP_INCLUDED #include "libtorrent/config.hpp" - -#ifndef TORRENT_DISABLE_LOGGING -#include "libtorrent/debug.hpp" -#endif - -#include "libtorrent/aux_/disable_warnings_push.hpp" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libtorrent/aux_/disable_warnings_pop.hpp" - #include "libtorrent/buffer.hpp" #include "libtorrent/peer_id.hpp" #include "libtorrent/stat.hpp" @@ -83,6 +60,28 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/io_service_fwd.hpp" #include "libtorrent/receive_buffer.hpp" +#ifndef TORRENT_DISABLE_LOGGING +#include "libtorrent/debug.hpp" +#endif + +#include "libtorrent/aux_/disable_warnings_push.hpp" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libtorrent/aux_/disable_warnings_pop.hpp" + namespace libtorrent { class torrent; diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index cd6fa40ba..9e7f6ac31 100644 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -988,7 +988,7 @@ namespace libtorrent int num_connect_candidates() const { return m_peer_list ? m_peer_list->num_connect_candidates() : 0; } piece_manager& storage(); - bool has_storage() const { return m_storage.get(); } + bool has_storage() const { return m_storage; } torrent_info const& torrent_file() const { return *m_torrent_file; } diff --git a/src/block_cache.cpp b/src/block_cache.cpp index 49ac021eb..9a485b0fb 100644 --- a/src/block_cache.cpp +++ b/src/block_cache.cpp @@ -1193,7 +1193,7 @@ void block_cache::insert_blocks(cached_piece_entry* pe, int block, file::iovec_t == m_deleted_storages.end()); #endif - cache_hit(pe, j->requester, j->flags & disk_io_job::volatile_read); + cache_hit(pe, j->requester, (j->flags & disk_io_job::volatile_read) != 0); TORRENT_ASSERT(pe->in_use); diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 0bde836af..1f1536ee5 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "libtorrent/config.hpp" + #include "libtorrent/aux_/disable_warnings_push.hpp" #include diff --git a/src/ut_pex.cpp b/src/ut_pex.cpp index e03d2d90a..a42bccb9f 100644 --- a/src/ut_pex.cpp +++ b/src/ut_pex.cpp @@ -31,15 +31,6 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "libtorrent/config.hpp" - -#ifndef TORRENT_DISABLE_EXTENSIONS - -#include "libtorrent/aux_/disable_warnings_push.hpp" - -#include - -#include "libtorrent/aux_/disable_warnings_pop.hpp" - #include "libtorrent/peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/bencode.hpp" @@ -58,6 +49,14 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/lazy_entry.hpp" #endif +#ifndef TORRENT_DISABLE_EXTENSIONS + +#include "libtorrent/aux_/disable_warnings_push.hpp" + +#include + +#include "libtorrent/aux_/disable_warnings_pop.hpp" + namespace libtorrent { namespace { const char extension_name[] = "ut_pex";