diff --git a/include/libtorrent/assert.hpp b/include/libtorrent/assert.hpp index 09ec54d2d..cd0a1e518 100644 --- a/include/libtorrent/assert.hpp +++ b/include/libtorrent/assert.hpp @@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. #if (defined TORRENT_DEBUG && TORRENT_USE_ASSERTS) \ || defined TORRENT_ASIO_DEBUGGING \ || defined TORRENT_PROFILE_CALLS \ - || TORRENT_RELEASE_ASSERTS \ + || defined TORRENT_RELEASE_ASSERTS \ || defined TORRENT_DEBUG_BUFFERS #include diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index f946f2774..35bbde9b3 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -639,14 +639,14 @@ int snprintf(char* buf, int len, char const* fmt, ...) // builds have asserts if they are explicitly enabled by // the release_asserts macro. #ifndef TORRENT_USE_ASSERTS -#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS +#if defined TORRENT_DEBUG || defined TORRENT_RELEASE_ASSERTS #define TORRENT_USE_ASSERTS 1 #else #define TORRENT_USE_ASSERTS 0 #endif #endif // TORRENT_USE_ASSERTS -#if defined TORRENT_DEBUG && defined TORRENT_USE_ASSERTS \ +#if defined TORRENT_DEBUG && TORRENT_USE_ASSERTS \ && !defined TORRENT_DISABLE_INVARIANT_CHECKS #define TORRENT_USE_INVARIANT_CHECKS 1 #else diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 6b35ed764..6825c8aa4 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -33,10 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_PEER_CONNECTION_HPP_INCLUDED #define TORRENT_PEER_CONNECTION_HPP_INCLUDED -#include -#include -#include -#include +#include "libtorrent/config.hpp" #ifndef TORRENT_DISABLE_LOGGING #include "libtorrent/debug.hpp" @@ -44,6 +41,11 @@ POSSIBILITY OF SUCH DAMAGE. #include "aux_/disable_warnings_push.hpp" +#include +#include +#include +#include + #include #include #include @@ -61,7 +63,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/alert.hpp" #include "libtorrent/peer_request.hpp" #include "libtorrent/piece_block_progress.hpp" -#include "libtorrent/config.hpp" #include "libtorrent/bandwidth_limit.hpp" #include "libtorrent/socket_type_fwd.hpp" #include "libtorrent/assert.hpp" diff --git a/src/assert.cpp b/src/assert.cpp index 6d5b5bb21..b21ad03e7 100644 --- a/src/assert.cpp +++ b/src/assert.cpp @@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE. #if (defined TORRENT_DEBUG && TORRENT_USE_ASSERTS) \ || defined TORRENT_ASIO_DEBUGGING \ || defined TORRENT_PROFILE_CALLS \ - || TORRENT_RELEASE_ASSERTS \ + || defined TORRENT_RELEASE_ASSERTS \ || defined TORRENT_DEBUG_BUFFERS #ifdef __APPLE__ @@ -296,9 +296,9 @@ TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(char const* expr, int line #else -TORRENT_EXPORT void assert_print(char const* fmt, ...) {} -TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file - , char const* function, char const* value, int kind) {} +TORRENT_EXPORT void assert_print(char const*, ...) {} +TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(char const*, int, char const* + , char const*, char const*, int) {} #endif diff --git a/src/crc32c.cpp b/src/crc32c.cpp index 48d137320..e1ba2e1e7 100644 --- a/src/crc32c.cpp +++ b/src/crc32c.cpp @@ -41,6 +41,8 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { + namespace { + bool supports_sse42() { #if TORRENT_HAS_SSE @@ -54,6 +56,8 @@ namespace libtorrent static bool sse42_support = supports_sse42(); + } // anonymous namespace + boost::uint32_t crc32c_32(boost::uint32_t v) { #if TORRENT_HAS_SSE