From 42fdd0f896ece886a94c03c36ac3363d39284685 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 21 Aug 2015 22:56:57 +0200 Subject: [PATCH] fix some more warnings --- include/libtorrent/assert.hpp | 3 ++- src/assert.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/libtorrent/assert.hpp b/include/libtorrent/assert.hpp index c3f50a218..e11fe657d 100644 --- a/include/libtorrent/assert.hpp +++ b/include/libtorrent/assert.hpp @@ -71,7 +71,8 @@ extern char const* libtorrent_assert_log; TORRENT_EXPORT void assert_print(char const* fmt, ...) TORRENT_FORMAT(1,2); -#if TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING +#if (TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING) \ + && !defined TORRENT_PRODUCTION_ASSERTS TORRENT_NO_RETURN #endif TORRENT_EXPORT void assert_fail(const char* expr, int line diff --git a/src/assert.cpp b/src/assert.cpp index 595beb844..292062f56 100644 --- a/src/assert.cpp +++ b/src/assert.cpp @@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/config.hpp" #include "libtorrent/assert.hpp" +#include "libtorrent/aux_/disable_warnings_push.hpp" + #ifdef TORRENT_PRODUCTION_ASSERTS #include #endif @@ -52,6 +54,8 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#include "libtorrent/aux_/disable_warnings_pop.hpp" + // uClibc++ doesn't have cxxabi.h #if defined __GNUC__ && __GNUC__ >= 3 \ && !defined __UCLIBCXX_MAJOR__ @@ -214,8 +218,10 @@ TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth) #ifdef TORRENT_PRODUCTION_ASSERTS char const* libtorrent_assert_log = "asserts.log"; +namespace { // the number of asserts we've printed to the log boost::atomic assert_counter(0); +} #endif TORRENT_FORMAT(1,2) @@ -239,7 +245,10 @@ TORRENT_EXPORT void assert_print(char const* fmt, ...) #endif } -TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(char const* expr, int line +#ifndef TORRENT_PRODUCTION_ASSERTS +TORRENT_NO_RETURN +#endif +TORRENT_EXPORT void assert_fail(char const* expr, int line , char const* file, char const* function, char const* value, int kind) { #ifdef TORRENT_PRODUCTION_ASSERTS