From 55a0a6e0df73273a3da175a21fc2207635bfddbf Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 22 May 2018 10:01:45 +0200 Subject: [PATCH] fix production asserts --- src/assert.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/assert.cpp b/src/assert.cpp index 7499530a5..66e51ab86 100644 --- a/src/assert.cpp +++ b/src/assert.cpp @@ -285,11 +285,8 @@ TORRENT_EXPORT void print_backtrace(char* out, int len, int /*max_depth*/, void* #endif -namespace libtorrent { - -#if TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING - -#ifdef TORRENT_PRODUCTION_ASSERTS +#if (TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING) && \ + defined TORRENT_PRODUCTION_ASSERTS char const* libtorrent_assert_log = "asserts.log"; namespace { // the number of asserts we've printed to the log @@ -297,6 +294,10 @@ std::atomic assert_counter(0); } #endif +namespace libtorrent { + +#if TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING + TORRENT_FORMAT(1,2) TORRENT_EXPORT void assert_print(char const* fmt, ...) {