invariant check define cleanup

This commit is contained in:
Arvid Norberg 2014-01-20 01:36:59 +00:00
parent dca3f3c1a8
commit 967c56dff8
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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