From c5d142ec9adbfafc072327db2f309245e39cea21 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 24 Apr 2018 15:12:09 +1000 Subject: [PATCH] debug: seperate SCOPED_SANITY from CHECK_SANITY the former is for checking immediately and a scope exit, the latter is for checking immediately. --- debug.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debug.hpp b/debug.hpp index 564ac93b..87ac774f 100644 --- a/debug.hpp +++ b/debug.hpp @@ -126,11 +126,15 @@ /////////////////////////////////////////////////////////////////////////////// -#define CHECK_SANITY(A) \ -::util::debug::scoped_sanity PASTE(__scoped_sanity_checker,__LINE__) (A); \ +#define SCOPED_SANITY(A) \ +::util::debug::scoped_sanity PASTE(__scoped_sanity_checker,__LINE__) ((A)); \ (void)PASTE(__scoped_sanity_checker,__LINE__); +/////////////////////////////////////////////////////////////////////////////// +#define CHECK_SANITY(A) CHECK(::util::debug::is_valid ((A))) + + /////////////////////////////////////////////////////////////////////////////// #define CHECK_EQ(A,B) do { \ DEBUG_ONLY ( \