summaryrefslogtreecommitdiff
path: root/src/utils/checkutils.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-04 22:12:01 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-04 22:12:01 +0300
commitbf9c58df65f48416dd7ae02cae96228ab6bec6d4 (patch)
treee1a8810a30f68f961099394b3c5fbf2613f8cfcb /src/utils/checkutils.h
parent62813629db182aa7098c6ab6fe63c304c2c729b0 (diff)
downloadplus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.tar.gz
plus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.tar.bz2
plus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.tar.xz
plus-bf9c58df65f48416dd7ae02cae96228ab6bec6d4.zip
Fix returnTrue/returnFalse macroses if asserts disabled.
Diffstat (limited to 'src/utils/checkutils.h')
-rw-r--r--src/utils/checkutils.h20
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