summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-21 17:42:24 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-21 17:42:24 +0100
commitbe0a659153bce07207c07b6146c315107e035724 (patch)
treec94ea86524697361934f4273db96b322e5fd83d1
parentRemoved cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :) (diff)
downloadcuberite-be0a659153bce07207c07b6146c315107e035724.tar
cuberite-be0a659153bce07207c07b6146c315107e035724.tar.gz
cuberite-be0a659153bce07207c07b6146c315107e035724.tar.bz2
cuberite-be0a659153bce07207c07b6146c315107e035724.tar.lz
cuberite-be0a659153bce07207c07b6146c315107e035724.tar.xz
cuberite-be0a659153bce07207c07b6146c315107e035724.tar.zst
cuberite-be0a659153bce07207c07b6146c315107e035724.zip
-rw-r--r--VC2010/MCServer.vcxproj4
-rw-r--r--source/Globals.h10
2 files changed, 11 insertions, 3 deletions
diff --git a/VC2010/MCServer.vcxproj b/VC2010/MCServer.vcxproj
index f4fb93398..7cb818c45 100644
--- a/VC2010/MCServer.vcxproj
+++ b/VC2010/MCServer.vcxproj
@@ -106,7 +106,7 @@
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -137,7 +137,7 @@
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PrecompiledHeader>Use</PrecompiledHeader>
diff --git a/source/Globals.h b/source/Globals.h
index c2aa3753c..592580153 100644
--- a/source/Globals.h
+++ b/source/Globals.h
@@ -120,7 +120,15 @@
/// Faster than (int)floorf((float)x / (float)div)
#define FAST_FLOOR_DIV( x, div ) ( (x) < 0 ? (((int)x / div) - 1) : ((int)x / div) )
-#define ASSERT( x ) { if( !(x) ) { LOGERROR("Assertion failed: \"%s\", file %s, line %i", #x, __FILE__, __LINE__ ); assert( !#x ); } }
+// Own version of assert() that writes failed assertions to the log for review
+#ifdef NDEBUG
+ #define ASSERT(x) ((void)0)
+#else
+ #define ASSERT( x ) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), assert(0), 0 ) )
+#endif
+
+// Pretty much the same as ASSERT() but stays in Release builds
+#define VERIFY( x ) ( !!(x) || ( LOGERROR("Verification failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), exit(1), 0 ) )