summaryrefslogtreecommitdiff
path: root/src/utils/checkutils.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-30 00:18:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-30 00:18:11 +0300
commit4029b40e800eb8654e6896576c521137835c55e2 (patch)
tree42403c484bf2112db5c5627a01371743919fdd0a /src/utils/checkutils.h
parent0c97cbd3ab4a6f425e42c2413d7dfe06c2da014e (diff)
downloadmanaverse-4029b40e800eb8654e6896576c521137835c55e2.tar.gz
manaverse-4029b40e800eb8654e6896576c521137835c55e2.tar.bz2
manaverse-4029b40e800eb8654e6896576c521137835c55e2.tar.xz
manaverse-4029b40e800eb8654e6896576c521137835c55e2.zip
Move report defines from debug.h into checkutils.h
Diffstat (limited to 'src/utils/checkutils.h')
-rw-r--r--src/utils/checkutils.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/checkutils.h b/src/utils/checkutils.h
index 8cd9a3ad5..ce4fcdc61 100644
--- a/src/utils/checkutils.h
+++ b/src/utils/checkutils.h
@@ -21,10 +21,24 @@
#ifndef UTILS_CHECKUTILS_H
#define UTILS_CHECKUTILS_H
+#ifdef ENABLE_ASSERTS
+
+#define reportFalse(val) reportFalse1(val, __FILE__, __LINE__)
+#define reportFalse1(val, file, line) reportFalseReal(val, file, line)
+
+#define reportTrue(val) reportTrue1(val, __FILE__, __LINE__)
+#define reportTrue1(val, file, line) reportTrueReal(val, file, line)
+
bool reportFalseReal(const bool val, const char *const file,
const unsigned line);
bool reportTrueReal(const bool val, const char *const file,
const unsigned line);
+#else // ENABLE_ASSERTS
+
+#define reportFalse(val) (val)
+#define reportTrue(val) (val)
+
+#endif // ENABLE_ASSERTS
#endif // UTILS_CHECKUTILS_H