From 967c56dff89b035c93e09bb763f0aa52a1d71699 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 20 Jan 2014 01:36:59 +0000 Subject: [PATCH] invariant check define cleanup --- include/libtorrent/config.hpp | 6 ++++++ include/libtorrent/invariant_check.hpp | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index f929f80ee..41b25c1bd 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -580,6 +580,12 @@ inline int snprintf(char* buf, int len, char const* fmt, ...) #endif #endif // TORRENT_USE_ASSERTS +#if TORRENT_USE_ASSERTS && !defined TORRENT_DISABLE_INVARIANT_CHECKS +#define TORRENT_USE_INVARIANT_CHECKS 1 +#else +#define TORRENT_USE_INVARIANT_CHECKS 0 +#endif + // for non-exception builds #ifdef BOOST_NO_EXCEPTIONS #define TORRENT_TRY if (true) diff --git a/include/libtorrent/invariant_check.hpp b/include/libtorrent/invariant_check.hpp index 51b226849..621e87978 100644 --- a/include/libtorrent/invariant_check.hpp +++ b/include/libtorrent/invariant_check.hpp @@ -67,14 +67,12 @@ namespace libtorrent } } -#if TORRENT_USE_ASSERTS && !defined TORRENT_DISABLE_INVARIANT_CHECKS -#define TORRENT_USE_INVARIANT_CHECKS 1 +#if TORRENT_USE_INVARIANT_CHECKS #define INVARIANT_CHECK \ invariant_checker const& _invariant_check = make_invariant_checker(*this); \ (void)_invariant_check; \ do {} while (false) #else -#define TORRENT_USE_INVARIANT_CHECKS 0 #define INVARIANT_CHECK do {} while (false) #endif