summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-02 13:12:34 +0200
committerMattes D <github@xoft.cz>2016-08-04 20:47:53 +0200
commitd1dee3c9092b7c270b297366757c9fc8d03bb0dd (patch)
treeccbb0e62481ce4944107294200c948f835494fe0 /src/Globals.h
parentMerge pull request #3293 from LogicParrot/blockArea (diff)
downloadcuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.gz
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.bz2
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.lz
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.xz
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.zst
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.zip
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 25d2f740e..e3a537eaa 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -370,15 +370,22 @@ template class SizeChecker<UInt8, 1>;
fflush(stdout); \
}
#endif
- #define ASSERT(x) do { if (!(x)) { throw cAssertFailure();} } while (0)
- #define testassert(x) do { if (!(x)) { REPORT_ERROR("Test failure: %s, file %s, line %d\n", #x, __FILE__, __LINE__); exit(1); } } while (0)
- #define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } REPORT_ERROR("Test failure: assert didn't fire for %s, file %s, line %d\n", #x, __FILE__, __LINE__); exit(1); } while (0)
+
+ #ifdef _DEBUG
+ #define ASSERT(x) do { if (!(x)) { throw cAssertFailure();} } while (0)
+ #define testassert(x) do { if (!(x)) { REPORT_ERROR("Test failure: %s, file %s, line %d\n", #x, __FILE__, __LINE__); exit(1); } } while (0)
+ #define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } REPORT_ERROR("Test failure: assert didn't fire for %s, file %s, line %d\n", #x, __FILE__, __LINE__); exit(1); } while (0)
+ #else
+ #define ASSERT(...)
+ #define testassert(...)
+ #define CheckAsserts(...) LOG("Assert checking is disabled in Release-mode executables (file %s, line %d)", __FILE__, __LINE__)
+ #endif
#else
- #ifdef _DEBUG
- #define ASSERT( x) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__), PrintStackTrace(), assert(0), 0))
+ #ifdef _DEBUG
+ #define ASSERT(x) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__), PrintStackTrace(), assert(0), 0))
#else
- #define ASSERT(x) ((void)(x))
+ #define ASSERT(x)
#endif
#endif