From bf9c58df65f48416dd7ae02cae96228ab6bec6d4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 4 May 2016 22:12:01 +0300 Subject: Fix returnTrue/returnFalse macroses if asserts disabled. --- src/utils/checkutils.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/utils/checkutils.h b/src/utils/checkutils.h index 9617ca140..7b76da8f1 100644 --- a/src/utils/checkutils.h +++ b/src/utils/checkutils.h @@ -85,10 +85,22 @@ void reportStack(const char *const file, #define reportTrue(val) (val) #define failFalse(val) (val) #define failTrue(val) (val) -#define returnTrueV(val) -#define returnFalseV(val) -#define returnTrue(val) -#define returnFalse(val) + +#define returnFalseV(val) \ + if (!val) \ + return; + +#define returnTrueV(val) \ + if (val) \ + return; + +#define returnFalse(ret, val) \ + if (!val) \ + return ret; + +#define returnTrue(ret, val) \ + if (val) \ + return ret; #endif // ENABLE_ASSERTS #endif // UTILS_CHECKUTILS_H -- cgit v1.2.3-70-g09d2