From 279ee66201c5cc795797837a9215cd2a1c12ad06 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 10 Mar 2013 20:41:26 +0000 Subject: [PATCH] fix release with assert-debugging build --- include/libtorrent/assert.hpp | 13 ++++++++----- include/libtorrent/debug.hpp | 1 + src/assert.cpp | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/libtorrent/assert.hpp b/include/libtorrent/assert.hpp index 17c2bcb56..c69b2bece 100644 --- a/include/libtorrent/assert.hpp +++ b/include/libtorrent/assert.hpp @@ -34,21 +34,24 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/config.hpp" +#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) || defined TORRENT_ASIO_DEBUGGING || TORRENT_RELEASE_ASSERTS +#include +std::string demangle(char const* name); +TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0); +#endif + #if (!defined TORRENT_DEBUG && !TORRENT_RELEASE_ASSERTS) \ || TORRENT_NO_ASSERTS + #define TORRENT_ASSERT(a) do {} while(false) #define TORRENT_ASSERT_VAL(a, b) do {} while(false) + #else #if TORRENT_PRODUCTION_ASSERTS extern char const* libtorrent_assert_log; #endif -#include - -std::string demangle(char const* name); -TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0); - #if (defined __linux__ || defined __MACH__) && defined __GNUC__ && !TORRENT_USE_SYSTEM_ASSERT #if TORRENT_USE_IOSTREAM diff --git a/include/libtorrent/debug.hpp b/include/libtorrent/debug.hpp index eef2862b6..dbb32ebb3 100644 --- a/include/libtorrent/debug.hpp +++ b/include/libtorrent/debug.hpp @@ -39,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/thread.hpp" #include +#include std::string demangle(char const* name); diff --git a/src/assert.cpp b/src/assert.cpp index 8610d71f7..fe577311a 100644 --- a/src/assert.cpp +++ b/src/assert.cpp @@ -32,7 +32,7 @@ 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 || TORRENT_RELEASE_ASSERTS #ifdef __APPLE__ #include