Преглед на файлове

Using JPH_CLANG_SUPPRESS_WARNING macro to suppress warning

Jorrit Rouwe преди 3 години
родител
ревизия
0a72b06827
променени са 2 файла, в които са добавени 4 реда и са изтрити 10 реда
  1. 2 5
      TestFramework/TestFramework.h
  2. 2 5
      UnitTests/UnitTestFramework.h

+ 2 - 5
TestFramework/TestFramework.h

@@ -5,8 +5,9 @@
 
 
 #include <Jolt/Jolt.h>
 #include <Jolt/Jolt.h>
 
 
-// Disable common warnings triggered by Jolt
+// Disable common warnings
 JPH_SUPPRESS_WARNINGS
 JPH_SUPPRESS_WARNINGS
+JPH_CLANG_SUPPRESS_WARNING("-Wheader-hygiene")
 
 
 #pragma warning (push, 0)
 #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.
 #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
 #include <wrl.h> // for ComPtr
 #pragma warning (pop)
 #pragma warning (pop)
 
 
-#if defined(JPH_COMPILER_CLANG)
-	#pragma clang diagnostic ignored "-Wheader-hygiene"
-#endif
-
 using Microsoft::WRL::ComPtr;
 using Microsoft::WRL::ComPtr;
 using namespace JPH;
 using namespace JPH;

+ 2 - 5
UnitTests/UnitTestFramework.h

@@ -6,12 +6,9 @@
 #include <Jolt/Math/Float2.h>
 #include <Jolt/Math/Float2.h>
 #include "doctest.h"
 #include "doctest.h"
 
 
-// Disable common warnings triggered by Jolt
+// Disable common warnings
 JPH_SUPPRESS_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;
 using namespace JPH;