debug: add CHECK_MOD

This commit is contained in:
Danny Robson 2016-08-03 18:12:05 +10:00
parent 74284415a7
commit d0a797d37e

View File

@ -231,6 +231,21 @@
} while (0)
///////////////////////////////////////////////////////////////////////////////
#define CHECK_MOD(V,M) do { \
DEBUG_ONLY ( \
const auto &__check_mod_v = (V); \
const auto &__check_mod_m = (M); \
if (!util::exactly_zero (__check_mod_v % __check_mod_m)) \
_CHECK_PANIC ("expected zero modulus\n" \
"__v: %s is %!\n" \
"__m: %s is %!", \
#V, __check_mod_v, \
#M, __check_mod_m); \
); \
} while (0)
///////////////////////////////////////////////////////////////////////////////
#if defined(ENABLE_DEBUGGING)
#define CHECK_ENUM(C, ...) do { \