diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-04 22:12:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-04 22:12:01 +0300 |
commit | bf9c58df65f48416dd7ae02cae96228ab6bec6d4 (patch) | |
tree | e1a8810a30f68f961099394b3c5fbf2613f8cfcb | |
parent | 62813629db182aa7098c6ab6fe63c304c2c729b0 (diff) | |
download | manaplus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.tar.gz manaplus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.tar.bz2 manaplus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.tar.xz manaplus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.zip |
Fix returnTrue/returnFalse macroses if asserts disabled.
-rw-r--r-- | src/utils/checkutils.h | 20 |
1 files changed, 16 insertions, 4 deletions
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 |