Browse Source

Fixed non-debug builds

Jorrit Rouwe 4 years ago
parent
commit
dd22e83641
1 changed files with 6 additions and 2 deletions
  1. 6 2
      UnitTests/UnitTestFramework.cpp

+ 6 - 2
UnitTests/UnitTestFramework.cpp

@@ -34,6 +34,8 @@ void TraceImpl(const char *inFMT, ...)
 	MESSAGE(buffer);
 	MESSAGE(buffer);
 }
 }
 
 
+#ifdef JPH_ENABLE_ASSERTS
+
 // Callback for asserts
 // Callback for asserts
 static bool AssertFailedImpl(const char *inExpression, const char *inMessage, const char *inFile, uint inLine)
 static bool AssertFailedImpl(const char *inExpression, const char *inMessage, const char *inFile, uint inLine)
 { 
 { 
@@ -48,6 +50,8 @@ static bool AssertFailedImpl(const char *inExpression, const char *inMessage, co
 	return false;
 	return false;
 };
 };
 
 
+#endif // JPH_ENABLE_ASSERTS
+
 #ifndef JPH_PLATFORM_ANDROID
 #ifndef JPH_PLATFORM_ANDROID
 
 
 // Generic entry point
 // Generic entry point
@@ -55,7 +59,7 @@ int main(int argc, char** argv)
 {
 {
 	// Install callbacks
 	// Install callbacks
 	Trace = TraceImpl;
 	Trace = TraceImpl;
-	AssertFailed = AssertFailedImpl;
+	JPH_IF_ENABLE_ASSERTS(AssertFailed = AssertFailedImpl;)
 
 
 #if defined(JPH_PLATFORM_WINDOWS) && defined(_DEBUG)
 #if defined(JPH_PLATFORM_WINDOWS) && defined(_DEBUG)
 	// Enable leak detection
 	// Enable leak detection
@@ -116,7 +120,7 @@ void AndroidInitialize(android_app *inApp)
 {
 {
 	// Install callbacks
 	// Install callbacks
 	Trace = TraceImpl;
 	Trace = TraceImpl;
-	AssertFailed = AssertFailedImpl;
+	JPH_IF_ENABLE_ASSERTS(AssertFailed = AssertFailedImpl;)
 
 
 	// Enable floating point exceptions
 	// Enable floating point exceptions
 	FPExceptionsEnable enable_exceptions;
 	FPExceptionsEnable enable_exceptions;