From 362b54421d0f41a36a84959930ee5205715f7555 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 30 Nov 2014 10:07:19 +0000 Subject: [PATCH] merged changes from RC_1_0 --- .regression.yml | 6 +++--- Jamfile | 21 +++++++++++++++++++++ include/libtorrent/assert.hpp | 7 ++++++- include/libtorrent/sliding_average.hpp | 3 ++- src/allocator.cpp | 3 +-- src/assert.cpp | 6 +++++- 6 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.regression.yml b/.regression.yml index 742737fef..cb3754485 100644 --- a/.regression.yml +++ b/.regression.yml @@ -3,8 +3,8 @@ test_dirs: - test features: - - variant=release asserts=production debug-symbols=on - - encryption=openssl logging=verbose disk-stats=on dht=logging request-log=on allocator=debug debug-iterators=on + - variant=test_release + - variant=test_debug # all build_features are built in these directories build_dirs: @@ -20,7 +20,7 @@ build_features: - asserts=off - asserts=production debug - asserts=on release - - ipv6=off dht=off extensions=off logging=none deprecated-functions=off invariant-checks=off + - variant=test_barebones project: libtorrent diff --git a/Jamfile b/Jamfile index a969a2619..5eb108a52 100755 --- a/Jamfile +++ b/Jamfile @@ -440,6 +440,27 @@ feature.compose on : TORRENT_PROFILE_CALLS=1 ; # libtorrent functions. Used for unit testing feature export-extra : off on : composite propagated ; + +# this is a trick to get filename paths to targets to become shorter +# making it possible to build on windows, especially mingw seems particular +variant test_release + : release : production on + full shared + on on source multi + ; +variant test_debug : debug + : openssl verbose on + logging on debug on + full shared + on on source multi + ; +variant test_barebones : debug + : off off off none shared + off off + on on source multi + ; + + # required for openssl on windows lib ssleay32 : : ssleay32 ; lib libeay32 : : libeay32 ; diff --git a/include/libtorrent/assert.hpp b/include/libtorrent/assert.hpp index 88148e0d4..46b210de8 100644 --- a/include/libtorrent/assert.hpp +++ b/include/libtorrent/assert.hpp @@ -34,7 +34,12 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/config.hpp" -#if defined TORRENT_DEBUG || defined TORRENT_ASIO_DEBUGGING || TORRENT_RELEASE_ASSERTS +#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) \ + || defined TORRENT_ASIO_DEBUGGING \ + || defined TORRENT_PROFILE_CALLS \ + || TORRENT_RELEASE_ASSERTS \ + || defined TORRENT_DEBUG_BUFFERS + #include std::string demangle(char const* name); TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0); diff --git a/include/libtorrent/sliding_average.hpp b/include/libtorrent/sliding_average.hpp index 82da22de7..de6c12d60 100644 --- a/include/libtorrent/sliding_average.hpp +++ b/include/libtorrent/sliding_average.hpp @@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_SLIDING_AVERAGE_HPP_INCLUDED #include +#include // for std::abs namespace libtorrent { @@ -52,7 +53,7 @@ struct sliding_average int deviation; if (m_num_samples > 0) - deviation = abs(m_mean - s); + deviation = std::abs(m_mean - s); if (m_num_samples < inverted_gain) ++m_num_samples; diff --git a/src/allocator.cpp b/src/allocator.cpp index dd21b632c..46793812e 100644 --- a/src/allocator.cpp +++ b/src/allocator.cpp @@ -181,9 +181,8 @@ namespace libtorrent #undef PROT_WRITE #endif -#if defined __linux__ || (defined __APPLE__ && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) print_backtrace(h->stack, sizeof(h->stack)); -#endif + #endif // TORRENT_DEBUG_BUFFERS #ifdef TORRENT_WINDOWS diff --git a/src/assert.cpp b/src/assert.cpp index c43a2f293..e0bac2170 100644 --- a/src/assert.cpp +++ b/src/assert.cpp @@ -36,7 +36,11 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif -#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) || defined TORRENT_ASIO_DEBUGGING || defined TORRENT_PROFILE_CALLS || TORRENT_RELEASE_ASSERTS +#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) \ + || defined TORRENT_ASIO_DEBUGGING \ + || defined TORRENT_PROFILE_CALLS \ + || TORRENT_RELEASE_ASSERTS \ + || defined TORRENT_DEBUG_BUFFERS #ifdef __APPLE__ #include