2
0
Эх сурвалжийг харах

Using JPH_CLANG_SUPPRESS_WARNING macro to suppress warning

Jorrit Rouwe 3 жил өмнө
parent
commit
0a72b06827

+ 2 - 5
TestFramework/TestFramework.h

@@ -5,8 +5,9 @@
 
 #include <Jolt/Jolt.h>
 
-// Disable common warnings triggered by Jolt
+// Disable common warnings
 JPH_SUPPRESS_WARNINGS
+JPH_CLANG_SUPPRESS_WARNING("-Wheader-hygiene")
 
 #pragma warning (push, 0)
 #pragma warning (disable : 5039) // winbase.h(13179): warning C5039: 'TpSetCallbackCleanupGroup': pointer or reference to potentially throwing function passed to 'extern "C"' function under -EHc. Undefined behavior may occur if this function throws an exception.
@@ -26,9 +27,5 @@ JPH_SUPPRESS_WARNINGS
 #include <wrl.h> // for ComPtr
 #pragma warning (pop)
 
-#if defined(JPH_COMPILER_CLANG)
-	#pragma clang diagnostic ignored "-Wheader-hygiene"
-#endif
-
 using Microsoft::WRL::ComPtr;
 using namespace JPH;

+ 2 - 5
UnitTests/UnitTestFramework.h

@@ -6,12 +6,9 @@
 #include <Jolt/Math/Float2.h>
 #include "doctest.h"
 
-// Disable common warnings triggered by Jolt
+// Disable common warnings
 JPH_SUPPRESS_WARNINGS
-
-#if defined(JPH_COMPILER_CLANG)
-	#pragma clang diagnostic ignored "-Wheader-hygiene"
-#endif
+JPH_CLANG_SUPPRESS_WARNING("-Wheader-hygiene")
 
 using namespace JPH;