diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 41b25c1bd..4ff59bab8 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -580,7 +580,8 @@ inline int snprintf(char* buf, int len, char const* fmt, ...) #endif #endif // TORRENT_USE_ASSERTS -#if TORRENT_USE_ASSERTS && !defined TORRENT_DISABLE_INVARIANT_CHECKS +#if defined TORRENT_DEBUG && TORRENT_USE_ASSERTS \ + && !defined TORRENT_DISABLE_INVARIANT_CHECKS #define TORRENT_USE_INVARIANT_CHECKS 1 #else #define TORRENT_USE_INVARIANT_CHECKS 0