invariant check define cleanup
This commit is contained in:
parent
dca3f3c1a8
commit
967c56dff8
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue