Pārlūkot izejas kodu

Disabled warnings now stay within the Jolt headers (#108)

This prevents warnings from accidentally being disabled in code that uses Jolt. 

If you want to disable common warnings caused by Jolt use the JPH_SUPPRESS_WARNINGS macro.
Jorrit Rouwe 3 gadi atpakaļ
vecāks
revīzija
8b62fa04c4
100 mainītis faili ar 366 papildinājumiem un 251 dzēšanām
  1. 3 0
      HelloWorld/HelloWorld.cpp
  2. 2 2
      Jolt/AABBTree/AABBTreeBuilder.cpp
  3. 2 2
      Jolt/AABBTree/AABBTreeBuilder.h
  4. 5 2
      Jolt/AABBTree/AABBTreeToBuffer.h
  5. 2 2
      Jolt/AABBTree/NodeCodec/NodeCodecQuadTreeHalfFloat.h
  6. 5 2
      Jolt/AABBTree/TriangleCodec/TriangleCodecIndexed8BitPackSOA4Flags.h
  7. 2 2
      Jolt/Core/AlignedAllocator.h
  8. 4 2
      Jolt/Core/Atomics.h
  9. 2 2
      Jolt/Core/ByteBuffer.h
  10. 2 2
      Jolt/Core/Color.cpp
  11. 2 2
      Jolt/Core/Color.h
  12. 105 50
      Jolt/Core/Core.h
  13. 2 2
      Jolt/Core/FPControlWord.h
  14. 2 2
      Jolt/Core/FPException.h
  15. 2 2
      Jolt/Core/FPFlushDenormals.h
  16. 2 2
      Jolt/Core/Factory.cpp
  17. 5 2
      Jolt/Core/Factory.h
  18. 5 2
      Jolt/Core/FixedSizeFreeList.h
  19. 2 2
      Jolt/Core/FixedSizeFreeList.inl
  20. 6 3
      Jolt/Core/HashCombine.h
  21. 5 2
      Jolt/Core/IssueReporting.cpp
  22. 2 2
      Jolt/Core/IssueReporting.h
  23. 5 2
      Jolt/Core/JobSystem.h
  24. 2 2
      Jolt/Core/JobSystem.inl
  25. 5 2
      Jolt/Core/JobSystemThreadPool.cpp
  26. 5 2
      Jolt/Core/JobSystemThreadPool.h
  27. 2 2
      Jolt/Core/LinearCurve.cpp
  28. 2 2
      Jolt/Core/LinearCurve.h
  29. 5 2
      Jolt/Core/LockFreeHashMap.h
  30. 2 2
      Jolt/Core/LockFreeHashMap.inl
  31. 5 2
      Jolt/Core/Memory.cpp
  32. 2 2
      Jolt/Core/Memory.h
  33. 7 4
      Jolt/Core/Mutex.h
  34. 2 2
      Jolt/Core/MutexArray.h
  35. 2 2
      Jolt/Core/NonCopyable.h
  36. 5 2
      Jolt/Core/Profiler.cpp
  37. 6 4
      Jolt/Core/Profiler.h
  38. 2 2
      Jolt/Core/Profiler.inl
  39. 2 2
      Jolt/Core/RTTI.cpp
  40. 2 2
      Jolt/Core/RTTI.h
  41. 4 2
      Jolt/Core/Reference.h
  42. 2 2
      Jolt/Core/Result.h
  43. 2 2
      Jolt/Core/StaticArray.h
  44. 2 2
      Jolt/Core/StreamIn.h
  45. 2 2
      Jolt/Core/StreamOut.h
  46. 5 2
      Jolt/Core/StreamWrapper.h
  47. 5 2
      Jolt/Core/StringTools.cpp
  48. 2 2
      Jolt/Core/StringTools.h
  49. 2 2
      Jolt/Core/TempAllocator.h
  50. 2 2
      Jolt/Core/TickCounter.cpp
  51. 2 2
      Jolt/Core/TickCounter.h
  52. 2 2
      Jolt/Geometry/AABox.h
  53. 2 2
      Jolt/Geometry/AABox4.h
  54. 2 2
      Jolt/Geometry/ClipPoly.h
  55. 2 2
      Jolt/Geometry/ClosestPoint.h
  56. 5 2
      Jolt/Geometry/ConvexHullBuilder.cpp
  57. 2 2
      Jolt/Geometry/ConvexHullBuilder.h
  58. 2 2
      Jolt/Geometry/ConvexHullBuilder2D.cpp
  59. 2 2
      Jolt/Geometry/ConvexHullBuilder2D.h
  60. 2 2
      Jolt/Geometry/ConvexSupport.h
  61. 2 2
      Jolt/Geometry/EPAConvexHullBuilder.h
  62. 2 2
      Jolt/Geometry/EPAPenetrationDepth.h
  63. 2 2
      Jolt/Geometry/Ellipse.h
  64. 2 2
      Jolt/Geometry/GJKClosestPoint.h
  65. 2 2
      Jolt/Geometry/IndexedTriangle.h
  66. 5 2
      Jolt/Geometry/Indexify.cpp
  67. 2 2
      Jolt/Geometry/Indexify.h
  68. 2 2
      Jolt/Geometry/MortonCode.h
  69. 2 2
      Jolt/Geometry/OrientedBox.cpp
  70. 2 2
      Jolt/Geometry/OrientedBox.h
  71. 2 2
      Jolt/Geometry/Plane.h
  72. 2 2
      Jolt/Geometry/RayAABox.h
  73. 2 2
      Jolt/Geometry/RayAABox8.h
  74. 2 2
      Jolt/Geometry/RayCapsule.h
  75. 2 2
      Jolt/Geometry/RayCylinder.h
  76. 2 2
      Jolt/Geometry/RaySphere.h
  77. 2 2
      Jolt/Geometry/RayTriangle.h
  78. 2 2
      Jolt/Geometry/RayTriangle8.h
  79. 2 2
      Jolt/Geometry/Sphere.h
  80. 2 2
      Jolt/Geometry/Triangle.h
  81. 2 2
      Jolt/Math/DVec3.h
  82. 2 2
      Jolt/Math/DVec3.inl
  83. 2 2
      Jolt/Math/EigenValueSymmetric.h
  84. 2 2
      Jolt/Math/FindRoot.h
  85. 2 2
      Jolt/Math/Float2.h
  86. 2 2
      Jolt/Math/Float3.h
  87. 2 2
      Jolt/Math/Float4.h
  88. 2 2
      Jolt/Math/GaussianElimination.h
  89. 2 2
      Jolt/Math/HalfFloat.h
  90. 2 2
      Jolt/Math/Mat44.h
  91. 2 2
      Jolt/Math/Mat44.inl
  92. 2 2
      Jolt/Math/Math.h
  93. 2 2
      Jolt/Math/MathTypes.h
  94. 2 2
      Jolt/Math/Matrix.h
  95. 2 2
      Jolt/Math/Quat.h
  96. 2 2
      Jolt/Math/Quat.inl
  97. 2 2
      Jolt/Math/Swizzle.h
  98. 2 2
      Jolt/Math/UVec4.cpp
  99. 2 2
      Jolt/Math/UVec4.h
  100. 2 2
      Jolt/Math/UVec4.inl

+ 3 - 0
HelloWorld/HelloWorld.cpp

@@ -21,6 +21,9 @@
 #include <cstdarg>
 #include <thread>
 
+// Disable common warnings triggered by Jolt, you can use JPH_SUPPRESS_WARNING_PUSH / JPH_SUPPRESS_WARNING_POP to store and restore the warning state
+JPH_SUPPRESS_WARNINGS
+
 // All Jolt symbols are in the JPH namespace
 using namespace JPH;
 

+ 2 - 2
Jolt/AABBTree/AABBTreeBuilder.cpp

@@ -5,7 +5,7 @@
 
 #include <Jolt/AABBTree/AABBTreeBuilder.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 AABBTreeBuilder::Node::Node()
 { 
@@ -221,4 +221,4 @@ AABBTreeBuilder::Node *AABBTreeBuilder::BuildInternal(const TriangleSplitter::Ra
 	return node;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/AABBTree/AABBTreeBuilder.h

@@ -7,7 +7,7 @@
 #include <Jolt/Geometry/AABox.h>
 #include <Jolt/Core/NonCopyable.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 struct AABBTreeBuilderStats
 {
@@ -104,4 +104,4 @@ private:
 	const uint				mMaxTrianglesPerLeaf;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/AABBTree/AABBTreeToBuffer.h

@@ -6,9 +6,12 @@
 #include <Jolt/AABBTree/AABBTreeBuilder.h>
 #include <Jolt/Core/ByteBuffer.h>
 #include <Jolt/Geometry/IndexedTriangle.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <deque>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// How the tree should be converted
 enum class EAABBTreeToBufferConvertMode
@@ -313,4 +316,4 @@ private:
 	uint							mNodesSize;								///< Size in bytes of the nodes in the buffer
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/AABBTree/NodeCodec/NodeCodecQuadTreeHalfFloat.h

@@ -7,7 +7,7 @@
 #include <Jolt/Math/HalfFloat.h>
 #include <Jolt/AABBTree/AABBTreeBuilder.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 template <int Alignment>
 class NodeCodecQuadTreeHalfFloat
@@ -287,4 +287,4 @@ public:
 	};
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/AABBTree/TriangleCodec/TriangleCodecIndexed8BitPackSOA4Flags.h

@@ -4,9 +4,12 @@
 #pragma once
 
 #include <Jolt/Geometry/RayTriangle.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <unordered_map>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Store vertices in 64 bits and indices in 8 bits + 8 bit of flags per triangle like this:
 ///
@@ -434,4 +437,4 @@ public:
 	};
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/AlignedAllocator.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/Memory.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// STL allocator that takes care that memory is aligned to N bytes
 template <typename T, size_t N>
@@ -64,4 +64,4 @@ public:
 	};
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 4 - 2
Jolt/Core/Atomics.h

@@ -3,9 +3,11 @@
 
 #pragma once
 
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <atomic>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Atomically compute the min(ioAtomic, inValue) and store it in ioAtomic, returns true if value was updated
 template <class T>
@@ -29,4 +31,4 @@ bool AtomicMax(atomic<T> &ioAtomic, const T inValue, const memory_order inMemory
 	return false;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/ByteBuffer.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/AlignedAllocator.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Underlying data type for ByteBuffer
 using ByteBufferVector = vector<uint8, AlignedAllocator<uint8, JPH_CACHE_LINE_SIZE>>;
@@ -70,4 +70,4 @@ public:
 	}
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/Color.cpp

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/Color.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 // Predefined colors
 const Color Color::sBlack(0, 0, 0);
@@ -34,4 +34,4 @@ Color Color::sGetDistinctColor(int inIndex)
 	return sColors[inIndex % (sizeof(sColors) / sizeof(uint32))];
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/Color.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class Color;
 
@@ -73,4 +73,4 @@ public:
 
 static_assert(is_trivial<Color>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END

+ 105 - 50
Jolt/Core/Core.h

@@ -21,60 +21,20 @@
     #endif
 #endif
 
-// Determine compiler and turn off warnings
+// Platform helper macros
+#ifdef JPH_PLATFORM_ANDROID
+	#define JPH_IF_NOT_ANDROID(x)
+#else
+	#define JPH_IF_NOT_ANDROID(x) x
+#endif
+
+// Determine compiler
 #if defined(__clang__)
 	#define JPH_COMPILER_CLANG
-
-	#pragma clang diagnostic ignored "-Wc++98-compat"
-	#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
-	#pragma clang diagnostic ignored "-Wfloat-equal"
-	#pragma clang diagnostic ignored "-Wnewline-eof"
-	#pragma clang diagnostic ignored "-Wsign-conversion"
-	#pragma clang diagnostic ignored "-Wold-style-cast"
-	#pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
-	#pragma clang diagnostic ignored "-Wnested-anon-types"
-	#pragma clang diagnostic ignored "-Wglobal-constructors"
-	#pragma clang diagnostic ignored "-Wexit-time-destructors"
-	#pragma clang diagnostic ignored "-Wnonportable-system-include-path"
-	#pragma clang diagnostic ignored "-Wlanguage-extension-token"
-	#pragma clang diagnostic ignored "-Wunused-parameter"
-	#pragma clang diagnostic ignored "-Wformat-nonliteral"
-	#pragma clang diagnostic ignored "-Wcovered-switch-default"
-	#pragma clang diagnostic ignored "-Wcast-align"
-	#pragma clang diagnostic ignored "-Winvalid-offsetof"
-	#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
-	#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
-	#pragma clang diagnostic ignored "-Wctad-maybe-unsupported"
-	#ifndef JPH_PLATFORM_ANDROID
-		#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
-	#endif
 #elif defined(__GNUC__)
 	#define JPH_COMPILER_GCC
-
-	#pragma GCC diagnostic ignored "-Wcomment"
-	#pragma GCC diagnostic ignored "-Winvalid-offsetof"
-	#pragma GCC diagnostic ignored "-Wclass-memaccess"
 #elif defined(_MSC_VER)
 	#define JPH_COMPILER_MSVC
-
-	#pragma warning (disable : 4514) // 'X' : unreferenced inline function has been removed
-	#pragma warning (disable : 4710) // 'X' : function not inlined
-	#pragma warning (disable : 4711) // function 'X' selected for automatic inline expansion
-	#pragma warning (disable : 4820) // 'X': 'Y' bytes padding added after data member 'Z'
-	#pragma warning (disable : 4100) // 'X' : unreferenced formal parameter
-	#pragma warning (disable : 4626) // 'X' : assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
-	#pragma warning (disable : 5027) // 'X' : move assignment operator was implicitly defined as deleted because a base class move assignment operator is inaccessible or deleted
-	#pragma warning (disable : 4365) // 'argument' : conversion from 'X' to 'Y', signed / unsigned mismatch
-	#pragma warning (disable : 4324) // 'X' : structure was padded due to alignment specifier
-	#pragma warning (disable : 4625) // 'X' : copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted
-	#pragma warning (disable : 5026) // 'X': move constructor was implicitly defined as deleted because a base class move constructor is inaccessible or deleted
-	#pragma warning (disable : 4623) // 'X' : default constructor was implicitly defined as deleted
-	#pragma warning (disable : 4201) // nonstandard extension used: nameless struct/union
-	#pragma warning (disable : 4371) // 'X': layout of class may have changed from a previous version of the compiler due to better packing of member 'Y'
-	#pragma warning (disable : 5045) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
-	#pragma warning (disable : 4583) // 'X': destructor is not implicitly called
-	#pragma warning (disable : 4582) // 'X': constructor is not implicitly called
-	#pragma warning (disable : 5219) // implicit conversion from 'X' to 'Y', possible loss of data 
 #endif
 
 // Detect CPU architecture
@@ -124,6 +84,79 @@
 	#error Unsupported CPU architecture
 #endif
 
+// Pragmas to store / restore the warning state and to disable individual warnings
+#ifdef JPH_COMPILER_CLANG
+#define JPH_PRAGMA(x)					_Pragma(#x)
+#define JPH_SUPPRESS_WARNING_PUSH		JPH_PRAGMA(clang diagnostic push)
+#define JPH_SUPPRESS_WARNING_POP		JPH_PRAGMA(clang diagnostic pop)
+#define JPH_CLANG_SUPPRESS_WARNING(w)	JPH_PRAGMA(clang diagnostic ignored w)
+#else
+#define JPH_CLANG_SUPPRESS_WARNING(w)
+#endif
+#ifdef JPH_COMPILER_GCC
+#define JPH_PRAGMA(x)					_Pragma(#x)
+#define JPH_SUPPRESS_WARNING_PUSH		JPH_PRAGMA(GCC diagnostic push)
+#define JPH_SUPPRESS_WARNING_POP		JPH_PRAGMA(GCC diagnostic pop)
+#define JPH_GCC_SUPPRESS_WARNING(w)		JPH_PRAGMA(GCC diagnostic ignored w)
+#else
+#define JPH_GCC_SUPPRESS_WARNING(w)
+#endif
+#ifdef JPH_COMPILER_MSVC
+#define JPH_PRAGMA(x)					__pragma(x)
+#define JPH_SUPPRESS_WARNING_PUSH		JPH_PRAGMA(warning (push))
+#define JPH_SUPPRESS_WARNING_POP		JPH_PRAGMA(warning (pop))
+#define JPH_MSVC_SUPPRESS_WARNING(w)	JPH_PRAGMA(warning (disable : w))
+#else
+#define JPH_MSVC_SUPPRESS_WARNING(w)
+#endif
+
+// Disable common warnings triggered by Jolt when compiling with -Wall
+#define JPH_SUPPRESS_WARNINGS																	\
+	JPH_CLANG_SUPPRESS_WARNING("-Wc++98-compat")												\
+	JPH_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic")										\
+	JPH_CLANG_SUPPRESS_WARNING("-Wfloat-equal")													\
+	JPH_CLANG_SUPPRESS_WARNING("-Wnewline-eof")													\
+	JPH_CLANG_SUPPRESS_WARNING("-Wsign-conversion")												\
+	JPH_CLANG_SUPPRESS_WARNING("-Wold-style-cast")												\
+	JPH_CLANG_SUPPRESS_WARNING("-Wgnu-anonymous-struct")										\
+	JPH_CLANG_SUPPRESS_WARNING("-Wnested-anon-types")											\
+	JPH_CLANG_SUPPRESS_WARNING("-Wglobal-constructors")											\
+	JPH_CLANG_SUPPRESS_WARNING("-Wexit-time-destructors")										\
+	JPH_CLANG_SUPPRESS_WARNING("-Wnonportable-system-include-path")								\
+	JPH_CLANG_SUPPRESS_WARNING("-Wlanguage-extension-token")									\
+	JPH_CLANG_SUPPRESS_WARNING("-Wunused-parameter")											\
+	JPH_CLANG_SUPPRESS_WARNING("-Wformat-nonliteral")											\
+	JPH_CLANG_SUPPRESS_WARNING("-Wcovered-switch-default")										\
+	JPH_CLANG_SUPPRESS_WARNING("-Wcast-align")													\
+	JPH_CLANG_SUPPRESS_WARNING("-Winvalid-offsetof")											\
+	JPH_CLANG_SUPPRESS_WARNING("-Wgnu-zero-variadic-macro-arguments")							\
+	JPH_CLANG_SUPPRESS_WARNING("-Wdocumentation-unknown-command")								\
+	JPH_CLANG_SUPPRESS_WARNING("-Wctad-maybe-unsupported")										\
+	JPH_IF_NOT_ANDROID(JPH_CLANG_SUPPRESS_WARNING("-Wimplicit-int-float-conversion"))			\
+																								\
+	JPH_GCC_SUPPRESS_WARNING("-Wcomment")														\
+	JPH_GCC_SUPPRESS_WARNING("-Winvalid-offsetof")												\
+	JPH_GCC_SUPPRESS_WARNING("-Wclass-memaccess")												\
+																								\
+	JPH_MSVC_SUPPRESS_WARNING(4514) /* 'X' : unreferenced inline function has been removed */	\
+	JPH_MSVC_SUPPRESS_WARNING(4710) /* 'X' : function not inlined */							\
+	JPH_MSVC_SUPPRESS_WARNING(4711) /* function 'X' selected for automatic inline expansion */	\
+	JPH_MSVC_SUPPRESS_WARNING(4820) /* 'X': 'Y' bytes padding added after data member 'Z' */	\
+	JPH_MSVC_SUPPRESS_WARNING(4100) /* 'X' : unreferenced formal parameter */					\
+	JPH_MSVC_SUPPRESS_WARNING(4626) /* 'X' : assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted */ \
+	JPH_MSVC_SUPPRESS_WARNING(5027) /* 'X' : move assignment operator was implicitly defined as deleted because a base class move assignment operator is inaccessible or deleted */ \
+	JPH_MSVC_SUPPRESS_WARNING(4365) /* 'argument' : conversion from 'X' to 'Y', signed / unsigned mismatch */ \
+	JPH_MSVC_SUPPRESS_WARNING(4324) /* 'X' : structure was padded due to alignment specifier */ \
+	JPH_MSVC_SUPPRESS_WARNING(4625) /* 'X' : copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted */ \
+	JPH_MSVC_SUPPRESS_WARNING(5026) /* 'X': move constructor was implicitly defined as deleted because a base class move constructor is inaccessible or deleted */ \
+	JPH_MSVC_SUPPRESS_WARNING(4623) /* 'X' : default constructor was implicitly defined as deleted */ \
+	JPH_MSVC_SUPPRESS_WARNING(4201) /* nonstandard extension used: nameless struct/union */		\
+	JPH_MSVC_SUPPRESS_WARNING(4371) /* 'X': layout of class may have changed from a previous version of the compiler due to better packing of member 'Y' */ \
+	JPH_MSVC_SUPPRESS_WARNING(5045) /* Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified */ \
+	JPH_MSVC_SUPPRESS_WARNING(4583) /* 'X': destructor is not implicitly called */				\
+	JPH_MSVC_SUPPRESS_WARNING(4582) /* 'X': constructor is not implicitly called */				\
+	JPH_MSVC_SUPPRESS_WARNING(5219) /* implicit conversion from 'X' to 'Y', possible loss of data  */
+
 // OS-specific includes
 #if defined(JPH_PLATFORM_WINDOWS)
 	#define JPH_BREAKPOINT		__debugbreak()
@@ -150,20 +183,42 @@
 // Crashes the application
 #define JPH_CRASH				do { int *ptr = nullptr; *ptr = 0; } while (false)
 
+// Begin the JPH namespace
+#define JPH_NAMESPACE_BEGIN					\
+	JPH_SUPPRESS_WARNING_PUSH				\
+	JPH_SUPPRESS_WARNINGS					\
+	namespace JPH {
+
+// End the JPH namespace
+#define JPH_NAMESPACE_END					\
+	}										\
+	JPH_SUPPRESS_WARNING_POP
+
+// On MSVC the std library generates warnings, use these macros to disable them
+#define JPH_SUPPRESS_WARNINGS_STD_BEGIN		\
+	JPH_SUPPRESS_WARNING_PUSH				\
+	JPH_MSVC_SUPPRESS_WARNING(4710)			\
+	JPH_MSVC_SUPPRESS_WARNING(4711)
+
+#define JPH_SUPPRESS_WARNINGS_STD_END		\
+	JPH_SUPPRESS_WARNING_POP
+
 // Standard C++ includes
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <vector>
 #include <algorithm>
 #include <utility>
 #include <cmath>
 #include <sstream>
 #include <functional>
+JPH_SUPPRESS_WARNINGS_STD_END
 #if defined(JPH_USE_SSE)
 	#include <immintrin.h>
 #elif defined(JPH_USE_NEON)
 	#include <arm_neon.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 using namespace std;
 
@@ -238,4 +293,4 @@ static_assert(sizeof(void *) == 8, "Invalid size of pointer");
 	#error Undefined
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/FPControlWord.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/NonCopyable.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 #ifdef JPH_USE_SSE
 
@@ -67,4 +67,4 @@ private:
 
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/FPException.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/FPControlWord.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
 
@@ -52,4 +52,4 @@ class FPExceptionDisableDivByZero { };
 
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/FPFlushDenormals.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/FPControlWord.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 #if defined(JPH_USE_SSE)
 
@@ -28,4 +28,4 @@ class FPFlushDenormals : public FPControlWord<FP_FZ, FP_FZ> { };
 
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/Factory.cpp

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/Factory.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 Factory Factory::sInstance;
 
@@ -69,4 +69,4 @@ vector<const RTTI *> Factory::GetAllClasses()
 	return all_classes;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/Factory.h

@@ -4,9 +4,12 @@
 #pragma once
 
 #include <Jolt/Core/RTTI.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <unordered_map>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Factory, to create RTTI objects
 class Factory
@@ -42,4 +45,4 @@ private:
 	ClassHashMap				mClassHashMap;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/FixedSizeFreeList.h

@@ -6,9 +6,12 @@
 #include <Jolt/Core/NonCopyable.h>
 #include <Jolt/Core/Mutex.h>
 #include <Jolt/Core/Memory.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <atomic>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Class that allows lock free creation / destruction of objects (unless a new page of objects needs to be allocated)
 /// It contains a fixed pool of objects and also allows batching up a lot of objects to be destroyed
@@ -119,6 +122,6 @@ public:
 	inline const Object &	Get(uint32 inObjectIndex) const			{ return reinterpret_cast<const Object &>(GetStorage(inObjectIndex).mData); }
 };
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "FixedSizeFreeList.inl"

+ 2 - 2
Jolt/Core/FixedSizeFreeList.inl

@@ -1,7 +1,7 @@
 // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
 // SPDX-License-Identifier: MIT
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 template <typename Object>
 FixedSizeFreeList<Object>::~FixedSizeFreeList()
@@ -202,4 +202,4 @@ inline void FixedSizeFreeList<Object>::DestructObject(Object *inObject)
 	DestructObject(index);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 6 - 3
Jolt/Core/HashCombine.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 inline void hash_combine(std::size_t &ioSeed) 
 { 
@@ -30,7 +30,7 @@ inline void hash_combine(std::size_t &ioSeed, const T &inValue, Rest... inRest)
     hash_combine(ioSeed, inRest...);
 }
 
-} // JPH
+JPH_NAMESPACE_END
 
 #define JPH_MAKE_HASH_STRUCT(type, name, ...)				\
 	struct [[nodiscard]] name								\
@@ -44,8 +44,11 @@ inline void hash_combine(std::size_t &ioSeed, const T &inValue, Rest... inRest)
     };
 
 #define JPH_MAKE_HASHABLE(type, ...)						\
+	JPH_SUPPRESS_WARNING_PUSH								\
+	JPH_SUPPRESS_WARNINGS									\
     namespace std											\
 	{														\
         template<>											\
 		JPH_MAKE_HASH_STRUCT(type, hash<type>, __VA_ARGS__)	\
-    }
+    }														\
+	JPH_SUPPRESS_WARNING_POP

+ 5 - 2
Jolt/Core/IssueReporting.cpp

@@ -2,9 +2,12 @@
 // SPDX-License-Identifier: MIT
 
 #include <Jolt/Jolt.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <fstream>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 static void DummyTrace(const char *inFMT, ...) 
 { 
@@ -24,4 +27,4 @@ AssertFailedFunction AssertFailed = DummyAssertFailed;
 
 #endif // JPH_ENABLE_ASSERTS
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/IssueReporting.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 	
 /// Trace function, needs to be overridden by application. This should output a line of text to the log / TTY.
 using TraceFunction = void (*)(const char *inFMT, ...);
@@ -34,4 +34,4 @@ extern TraceFunction Trace;
 	#define JPH_IF_ENABLE_ASSERTS(...)	
 #endif // JPH_ENABLE_ASSERTS
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/JobSystem.h

@@ -8,9 +8,12 @@
 #include <Jolt/Core/Profiler.h>
 #include <Jolt/Core/NonCopyable.h>
 #include <Jolt/Core/StaticArray.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <atomic>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// A class that allows units of work (Jobs) to be scheduled across multiple threads.
 /// It allows dependencies between the jobs so that the jobs form a graph.
@@ -250,6 +253,6 @@ private:
 
 using JobHandle = JobSystem::JobHandle;
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "JobSystem.inl"

+ 2 - 2
Jolt/Core/JobSystem.inl

@@ -1,7 +1,7 @@
 // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
 // SPDX-License-Identifier: MIT
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 void JobSystem::Job::AddDependency(int inCount)
 {
@@ -52,4 +52,4 @@ void JobSystem::JobHandle::sRemoveDependencies(JobHandle *inHandles, uint inNumH
 		job_system->QueueJobs(jobs_to_queue, num_jobs_to_queue);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/JobSystemThreadPool.cpp

@@ -6,7 +6,10 @@
 #include <Jolt/Core/JobSystemThreadPool.h>
 #include <Jolt/Core/Profiler.h>
 #include <Jolt/Core/FPException.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <algorithm>
+JPH_SUPPRESS_WARNINGS_STD_END
 
 #ifdef JPH_PLATFORM_WINDOWS
 	#pragma warning (push, 0)
@@ -16,7 +19,7 @@
 	#pragma warning (pop)
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 JobSystemThreadPool::Semaphore::Semaphore()
 {
@@ -560,4 +563,4 @@ void JobSystemThreadPool::ThreadMain([[maybe_unused]] const string &inName, int
 	JPH_PROFILE_THREAD_END();
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/JobSystemThreadPool.h

@@ -5,11 +5,14 @@
 
 #include <Jolt/Core/JobSystem.h>
 #include <Jolt/Core/FixedSizeFreeList.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <thread>
 #include <mutex>
 #include <condition_variable>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Implementation of a JobSystem using a thread pool
 /// 
@@ -147,4 +150,4 @@ private:
 	atomic<bool>			mQuit = false;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/LinearCurve.cpp

@@ -8,7 +8,7 @@
 #include <Jolt/Core/StreamOut.h>
 #include <Jolt/ObjectStream/TypeDeclarations.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 JPH_IMPLEMENT_SERIALIZABLE_NON_VIRTUAL(LinearCurve::Point)
 {
@@ -47,4 +47,4 @@ void LinearCurve::RestoreBinaryState(StreamIn &inStream)
 	inStream.Read(mPoints);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/LinearCurve.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/ObjectStream/SerializableObject.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class StreamOut;
 class StreamIn;
@@ -62,4 +62,4 @@ public:
 	Points				mPoints;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/LockFreeHashMap.h

@@ -4,9 +4,12 @@
 #pragma once
 
 #include <Jolt/Core/NonCopyable.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <atomic>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Allocator for a lock free hash map
 class LFHMAllocator : public NonCopyable
@@ -175,6 +178,6 @@ private:
 	uint32					mMaxBuckets = 0;				///< Maximum number of buckets
 };
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "LockFreeHashMap.inl"

+ 2 - 2
Jolt/Core/LockFreeHashMap.inl

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 ///////////////////////////////////////////////////////////////////////////////////
 // LFHMAllocator
@@ -329,4 +329,4 @@ void LockFreeHashMap<Key, Value>::TraceStats() const
 
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/Memory.cpp

@@ -4,10 +4,13 @@
 #include <Jolt/Jolt.h>
 
 #include <Jolt/Core/Memory.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <cstdlib>
+JPH_SUPPRESS_WARNINGS_STD_END
 #include <stdlib.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 void *AlignedAlloc(size_t inSize, size_t inAlignment)
 {
@@ -32,4 +35,4 @@ void AlignedFree(void *inBlock)
 #endif
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/Memory.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Allocate a block of memory aligned to inAlignment bytes of size inSize
 void *AlignedAlloc(size_t inSize, size_t inAlignment);
@@ -11,4 +11,4 @@ void *AlignedAlloc(size_t inSize, size_t inAlignment);
 /// Free memory block allocated with AlignedAlloc
 void AlignedFree(void *inBlock);
 
-} // JPH
+JPH_NAMESPACE_END

+ 7 - 4
Jolt/Core/Mutex.h

@@ -3,13 +3,16 @@
 
 #pragma once
 
+#include <Jolt/Core/Profiler.h>
+#include <Jolt/Core/NonCopyable.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <mutex>
 #include <shared_mutex>
 #include <thread>
-#include <Jolt/Core/Profiler.h>
-#include <Jolt/Core/NonCopyable.h>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 #ifdef JPH_PLATFORM_BLUE
 
@@ -208,4 +211,4 @@ using SharedMutex = SharedMutexBase;
 
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/MutexArray.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/NonCopyable.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// A mutex array protects a number of resources with a limited amount of mutexes.
 /// It uses hashing to find the mutex of a particular object.
@@ -91,5 +91,5 @@ private:
 	uint					mNumMutexes = 0;
 };
 
-} // JPH
+JPH_NAMESPACE_END
 

+ 2 - 2
Jolt/Core/NonCopyable.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
 class NonCopyable
@@ -14,4 +14,4 @@ public:
 	void	operator = (const NonCopyable &) = delete;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/Profiler.cpp

@@ -6,11 +6,14 @@
 #include <Jolt/Core/Profiler.h>
 #include <Jolt/Core/Color.h>
 #include <Jolt/Core/StringTools.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <fstream>
+JPH_SUPPRESS_WARNINGS_STD_END
 
 #ifdef JPH_PROFILE_ENABLED
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // Profiler
@@ -392,6 +395,6 @@ void Profiler::DumpChart(string inTag, const Threads &inThreads, const KeyToAggr
 </tbody></table></body></html>)";
 }
 
-} // JPH
+JPH_NAMESPACE_END
 
 #endif // JPH_PROFILE_ENABLED

+ 6 - 4
Jolt/Core/Profiler.h

@@ -3,15 +3,17 @@
 
 #pragma once
 
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <mutex>
 #include <unordered_map>
+JPH_SUPPRESS_WARNINGS_STD_END
 
 #include <Jolt/Core/NonCopyable.h>
 #include <Jolt/Core/TickCounter.h>
 
 #if defined(JPH_EXTERNAL_PROFILE)
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Create this class on the stack to start sampling timing information of a particular scope.
 ///
@@ -28,7 +30,7 @@ private:
 	uint8							mUserData[64];
 };
 
-} // JPH
+JPH_NAMESPACE_END
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // Macros to do the actual profiling	
@@ -60,7 +62,7 @@ private:
 
 #elif defined(JPH_PROFILE_ENABLED)
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class ProfileSample;
 class ProfileThread;
@@ -190,7 +192,7 @@ private:
 	static bool					sOutOfSamplesReported;
 };
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "Profiler.inl"
 

+ 2 - 2
Jolt/Core/Profiler.inl

@@ -1,7 +1,7 @@
 // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
 // SPDX-License-Identifier: MIT
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // ProfileThread
@@ -84,4 +84,4 @@ ProfileMeasurement::~ProfileMeasurement()
 	}
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/RTTI.cpp

@@ -6,7 +6,7 @@
 #include <Jolt/Core/RTTI.h>
 #include <Jolt/Core/StringTools.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 JPH_IMPLEMENT_RTTI_VIRTUAL_BASE(RTTIAttribute)
 {
@@ -152,4 +152,4 @@ const RTTIAttribute *RTTI::GetAttribute(const RTTI *inRTTI, const char *inName)
 	return nullptr;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/RTTI.h

@@ -6,7 +6,7 @@
 #include <Jolt/Core/Reference.h>
 #include <Jolt/Core/StaticArray.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // RTTI
@@ -464,4 +464,4 @@ private:
 	const char *				mName;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 4 - 2
Jolt/Core/Reference.h

@@ -3,9 +3,11 @@
 
 #pragma once
 
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <atomic>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 // Forward declares
 template <class T> class Ref;
@@ -186,7 +188,7 @@ private:
 	const T *				mPtr;											///< Pointer to object that we are reference counting
 };						
 
-} // JPH
+JPH_NAMESPACE_END
 
 namespace std
 {

+ 2 - 2
Jolt/Core/Result.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Helper class that either contains a valid result or an error
 template <class Type>
@@ -172,4 +172,4 @@ private:
 	EState				mState = EState::Invalid;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/StaticArray.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Simple variable length array backed by a fixed size buffer
 template <class T, uint N>
@@ -279,7 +279,7 @@ protected:
 	Storage				mElements[N];
 };
 
-} // JPH
+JPH_NAMESPACE_END
 
 namespace std
 {

+ 2 - 2
Jolt/Core/StreamIn.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Simple binary input stream
 class StreamIn
@@ -66,4 +66,4 @@ public:
 	}
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/StreamOut.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Simple binary output stream
 class StreamOut
@@ -52,4 +52,4 @@ public:
 	}
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/StreamWrapper.h

@@ -5,9 +5,12 @@
 
 #include <Jolt/Core/StreamIn.h>
 #include <Jolt/Core/StreamOut.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <ostream>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Wrapper around std::ostream
 class StreamOutWrapper : public StreamOut
@@ -46,4 +49,4 @@ private:
 	istream &			mWrapped;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Core/StringTools.cpp

@@ -4,9 +4,12 @@
 #include <Jolt/Jolt.h>
 
 #include <Jolt/Core/StringTools.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <cstdarg>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 string StringFormat(const char *inFMT, ...)
 {
@@ -93,4 +96,4 @@ const char *NibbleToBinary(uint32 inNibble)
 	return nibbles[inNibble & 0xf];
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/StringTools.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Create a formatted text string
 string StringFormat(const char *inFMT, ...);
@@ -45,4 +45,4 @@ string ToLower(const string &inString);
 /// Converts the lower 4 bits of inNibble to a string that represents the number in binary format
 const char *NibbleToBinary(uint32 inNibble);
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/TempAllocator.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Allocator for temporary allocations. 
 /// This allocator works as a stack: The blocks must always be freed in the reverse order as they are allocated.
@@ -97,4 +97,4 @@ public:
 	}
 };
 
-}; // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/TickCounter.cpp

@@ -18,7 +18,7 @@
 	#include <sys/sysctl.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 static const uint64 sProcessorTicksPerSecond = []() {
 #if defined(JPH_PLATFORM_WINDOWS)
@@ -95,4 +95,4 @@ uint64 GetProcessorTicksPerSecond()
 	return sProcessorTicksPerSecond;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Core/TickCounter.h

@@ -10,7 +10,7 @@
 	#include <x86intrin.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Functionality to get the processors cycle counter 
 JPH_INLINE uint64 GetProcessorTickCount()
@@ -31,4 +31,4 @@ JPH_INLINE uint64 GetProcessorTickCount()
 /// Get the amount of ticks per second, note that this number will never be fully accurate as the amound of ticks per second may vary with CPU load, so this number is only to be used to give an indication of time for profiling purposes
 uint64 GetProcessorTicksPerSecond();
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/AABox.h

@@ -8,7 +8,7 @@
 #include <Jolt/Geometry/Plane.h>
 #include <Jolt/Math/Mat44.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Axis aligned box
 class [[nodiscard]] AABox
@@ -276,4 +276,4 @@ public:
 	Vec3			mMax;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/AABox4.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Geometry/OrientedBox.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Helper functions that process 4 axis aligned boxes at the same time using SIMD
 /// Test if 4 bounding boxes overlap with 1 bounding box, splat 1 box
@@ -207,4 +207,4 @@ JPH_INLINE UVec4 AABox4VsSphere(Vec3 inCenter, float inRadiusSq, Vec4Arg inBoxMi
 	return AABox4VsSphere(inCenter.SplatX(), inCenter.SplatY(), inCenter.SplatZ(), Vec4::sReplicate(inRadiusSq), inBoxMinX, inBoxMinY, inBoxMinZ, inBoxMaxX, inBoxMaxY, inBoxMaxZ);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/ClipPoly.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Geometry/AABox.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Clip inPolygonToClip against the positive halfspace of plane defined by inPlaneOrigin and inPlaneNormal.
 /// inPlaneNormal does not need to be normalized.
@@ -196,4 +196,4 @@ void ClipPolyVsAABox(const VERTEX_ARRAY &inPolygonToClip, const AABox &inAABox,
 		}
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/ClosestPoint.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 // Turn off fused multiply add instruction because it makes the equations of the form a * b - c * d inaccurate below
 JPH_PRECISE_MATH_ON
@@ -418,4 +418,4 @@ namespace ClosestPoint
 
 JPH_PRECISE_MATH_OFF
 
-} // JPH
+JPH_NAMESPACE_END

+ 5 - 2
Jolt/Geometry/ConvexHullBuilder.cpp

@@ -7,14 +7,17 @@
 #include <Jolt/Geometry/ConvexHullBuilder2D.h>
 #include <Jolt/Geometry/ClosestPoint.h>
 #include <Jolt/Core/StringTools.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <unordered_set>
 #include <fstream>
+JPH_SUPPRESS_WARNINGS_STD_END
 
 #ifdef JPH_CONVEX_BUILDER_DEBUG
 	#include <Jolt/Renderer/DebugRenderer.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 ConvexHullBuilder::Face::~Face()
 {
@@ -1372,4 +1375,4 @@ void ConvexHullBuilder::DumpShape() const
 
 #endif // JPH_CONVEX_BUILDER_DUMP_SHAPE
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/ConvexHullBuilder.h

@@ -13,7 +13,7 @@
 #include <Jolt/Core/StaticArray.h>
 #include <Jolt/Core/NonCopyable.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// A convex hull builder that tries to create hulls as accurately as possible. Used for offline processing.
 class ConvexHullBuilder : public NonCopyable
@@ -240,4 +240,4 @@ private:
 #endif
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/ConvexHullBuilder2D.cpp

@@ -9,7 +9,7 @@
 	#include <Jolt/Renderer/DebugRenderer.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 void ConvexHullBuilder2D::Edge::CalculateNormalAndCenter(const Vec3 *inPositions)
 {
@@ -332,4 +332,4 @@ void ConvexHullBuilder2D::DrawState()
 
 #endif
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/ConvexHullBuilder2D.h

@@ -7,7 +7,7 @@
 
 //#define JPH_CONVEX_BUILDER_2D_DEBUG
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// A convex hull builder that tries to create 2D hulls as accurately as possible. Used for offline processing. 
 class ConvexHullBuilder2D : public NonCopyable
@@ -99,4 +99,4 @@ private:
 #endif
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/ConvexSupport.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/Mat44.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Helper functions to get the support point for a convex object
 /// Structure that transforms a convex object (supports only uniform scaling)
@@ -184,4 +184,4 @@ struct PolygonConvexSupport
 	const VERTEX_ARRAY &	mVertices;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/EPAConvexHullBuilder.h

@@ -16,7 +16,7 @@
 	#include <Jolt/Core/StringTools.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// A convex hull builder specifically made for the EPA penetration depth calculation. It trades accuracy for speed and will simply abort of the hull forms defects due to numerical precision problems.
 class EPAConvexHullBuilder : public NonCopyable
@@ -823,4 +823,4 @@ EPAConvexHullBuilder::Triangle::Triangle(int inIdx0, int inIdx1, int inIdx2, con
 
 JPH_PRECISE_MATH_OFF
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/EPAPenetrationDepth.h

@@ -8,7 +8,7 @@
 #include <Jolt/Geometry/GJKClosestPoint.h>
 #include <Jolt/Geometry/EPAConvexHullBuilder.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Implementation of Expanding Polytope Algorithm as described in:
 ///
@@ -447,4 +447,4 @@ public:
 	}
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/Ellipse.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/Float2.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Ellipse centered around the origin
 /// @see https://en.wikipedia.org/wiki/Ellipse
@@ -71,4 +71,4 @@ private:
 	float			mB;				///< Radius along Y-axis
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/GJKClosestPoint.h

@@ -14,7 +14,7 @@
 	#include <Jolt/Renderer/DebugRenderer.h>
 #endif
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Convex vs convex collision detection
 /// Based on: A Fast and Robust GJK Implementation for Collision Detection of Convex Objects - Gino van den Bergen
@@ -963,4 +963,4 @@ private:
 #endif
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/IndexedTriangle.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/HashCombine.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Triangle with 32-bit indices
 class IndexedTriangleNoMaterial
@@ -101,7 +101,7 @@ public:
 using IndexedTriangleNoMaterialList = vector<IndexedTriangleNoMaterial>;
 using IndexedTriangleList = vector<IndexedTriangle>;
 
-} // JPH
+JPH_NAMESPACE_END
 
 // Create a std::hash for IndexedTriangleNoMaterial and IndexedTriangle
 JPH_MAKE_HASHABLE(JPH::IndexedTriangleNoMaterial, t.mIdx[0], t.mIdx[1], t.mIdx[2])

+ 5 - 2
Jolt/Geometry/Indexify.cpp

@@ -4,9 +4,12 @@
 #include <Jolt/Jolt.h>
 
 #include <Jolt/Geometry/Indexify.h>
+
+JPH_SUPPRESS_WARNINGS_STD_BEGIN
 #include <unordered_map>
+JPH_SUPPRESS_WARNINGS_STD_END
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 void Indexify(const TriangleList &inTriangles, VertexList &outVertices, IndexedTriangleList &outTriangles, float inVertexWeldDistance)
 {
@@ -68,4 +71,4 @@ void Deindexify(const VertexList &inVertices, const IndexedTriangleList &inTrian
 			outTriangles[t].mV[v] = inVertices[inTriangles[t].mIdx[v]];
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/Indexify.h

@@ -6,7 +6,7 @@
 #include <Jolt/Geometry/Triangle.h>
 #include <Jolt/Geometry/IndexedTriangle.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Take a list of triangles and get the unique set of vertices and use them to create indexed triangles.
 /// Vertices that are less than inVertexWeldDistance apart will be combined to a single vertex.
@@ -15,4 +15,4 @@ void Indexify(const TriangleList &inTriangles, VertexList &outVertices, IndexedT
 /// Take a list of indexed triangles and unpack them
 void Deindexify(const VertexList &inVertices, const IndexedTriangleList &inTriangles, TriangleList &outTriangles);
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/MortonCode.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Geometry/AABox.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class MortonCode
 {
@@ -36,4 +36,4 @@ public:
 	}
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/OrientedBox.cpp

@@ -6,7 +6,7 @@
 #include <Jolt/Geometry/AABox.h>
 #include <Jolt/Geometry/OrientedBox.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 bool OrientedBox::Overlaps(const AABox &inBox, float inEpsilon) const
 {
@@ -174,4 +174,4 @@ bool OrientedBox::Overlaps(const OrientedBox &inBox, float inEpsilon) const
 	return true;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/OrientedBox.h

@@ -8,7 +8,7 @@
 #include <Jolt/Geometry/AABox.h>
 #include <Jolt/Math/Mat44.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class AABox;
 
@@ -34,4 +34,4 @@ public:
 	Vec3			mHalfExtents;														///< Half extents (half the size of the edge) of the local space axis aligned box
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/Plane.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// An infinite plane described by the formula X . Normal + Constant = 0.
 class [[nodiscard]] Plane
@@ -70,4 +70,4 @@ private:
 	Vec4			mNormalAndConstant;													///< XYZ = normal, W = constant, plane: x . normal + constant = 0
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RayAABox.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Helper structure holding the reciprocal of a ray for Ray vs AABox testing
 class RayInvDirection
@@ -237,4 +237,4 @@ JPH_INLINE bool RayAABoxHits(Vec3Arg inOrigin, Vec3Arg inDirection, Vec3Arg inBo
 	return !no_intersection.TestAnyXYZTrue();
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RayAABox8.h

@@ -6,7 +6,7 @@
 #include <Jolt/Math/Vec8.h>
 #include <Jolt/Geometry/RayAABox.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Intersect 8 AABBs with ray, returns minimal distance along ray or FLT_MAX if no hit
 /// Note: Can return negative value if ray starts in box
@@ -72,4 +72,4 @@ JPH_INLINE Vec8 RayAABox8(Vec3Arg inOrigin, const RayInvDirection &inInvDirectio
 	return Vec8::sSelect(t_min, flt_max, no_intersection);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RayCapsule.h

@@ -6,7 +6,7 @@
 #include <Jolt/Geometry/RayCylinder.h>
 #include <Jolt/Geometry/RaySphere.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection
 /// against a capsule centered around the origin with its axis along the Y axis and half height specified.
@@ -33,4 +33,4 @@ JPH_INLINE float RayCapsule(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float i
 	return min(upper, lower);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RayCylinder.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/FindRoot.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection
 /// against an infinite cylinder centered along the Y axis
@@ -97,4 +97,4 @@ JPH_INLINE float RayCylinder(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float
 	return FLT_MAX;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RaySphere.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/FindRoot.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against a sphere, 
 /// @return FLT_MAX if there is no intersection, otherwise the fraction along the ray.
@@ -92,4 +92,4 @@ JPH_INLINE int RaySphere(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, Vec3Arg in
 	}
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RayTriangle.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Intersect ray with triangle, returns closest point or FLT_MAX if no hit (branch less version)
 /// Adapted from: http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
@@ -154,4 +154,4 @@ JPH_INLINE Vec4 RayTriangle4(Vec3Arg inOrigin, Vec3Arg inDirection, Vec4Arg inV0
 	return Vec4::sSelect(t / det, Vec4::sReplicate(FLT_MAX), no_intersection);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/RayTriangle8.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/Vec8.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Intersect ray with 8 triangles in SOA format, returns 8 vector of closest points or FLT_MAX if no hit
 JPH_INLINE Vec8 RayTriangle8(Vec3Arg inOrigin, Vec3Arg inDirection, Vec8Arg inV0X, Vec8Arg inV0Y, Vec8Arg inV0Z, Vec8Arg inV1X, Vec8Arg inV1Y, Vec8Arg inV1Z, Vec8Arg inV2X, Vec8Arg inV2Y, Vec8Arg inV2Z)
@@ -87,4 +87,4 @@ JPH_INLINE Vec8 RayTriangle8(Vec3Arg inOrigin, Vec3Arg inDirection, Vec8Arg inV0
 	return Vec8::sSelect(t, Vec8::sReplicate(FLT_MAX), no_intersection);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/Sphere.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Geometry/AABox.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class [[nodiscard]] Sphere
 {
@@ -66,4 +66,4 @@ private:
 	float				mRadius;
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Geometry/Triangle.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// A simple triangle and its material
 class Triangle
@@ -28,4 +28,4 @@ public:
 
 using TriangleList = vector<Triangle>;
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/DVec3.h

@@ -7,7 +7,7 @@
 
 #ifdef JPH_USE_AVX2 // DVec3 currently uses AVX2 intrinsics but the class is currently unused so we can leave it out (it will be used in the future to support objects at a large distance from the origin)
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// 3 component vector of doubles (stored as 4 vectors). 
 /// Note that we keep the 4th component the same as the 3rd component to avoid divisions by zero when JPH_FLOATING_POINT_EXCEPTIONS_ENABLED defined
@@ -214,7 +214,7 @@ private:
 
 static_assert(is_trivial<DVec3>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "DVec3.inl"
 

+ 2 - 2
Jolt/Math/DVec3.inl

@@ -8,7 +8,7 @@
 // Create a std::hash for DVec3
 JPH_MAKE_HASHABLE(JPH::DVec3, t.GetX(), t.GetY(), t.GetZ())
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 DVec3::DVec3(Vec3Arg inRHS) : 
 	mValue(_mm256_cvtps_pd(inRHS.mValue))
@@ -274,4 +274,4 @@ DVec3 DVec3::GetSign() const
 	return _mm256_or_pd(_mm256_and_pd(mValue, minus_one), one);
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/EigenValueSymmetric.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/FPFlushDenormals.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Function to determine the eigen vectors and values of a N x N real symmetric matrix
 /// by Jacobi transformations. This method is most suitable for N < 10.
@@ -170,4 +170,4 @@ bool EigenValueSymmetric(const Matrix &inMatrix, Matrix &outEigVec, Vector &outE
 	return false;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/FindRoot.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Find the roots of \f$inA \: x^2 + inB \: x + inC = 0\f$.
 /// @return The number of roots, actual roots in outX1 and outX2.
@@ -38,4 +38,4 @@ inline int FindRoot(const T inA, const T inB, const T inC, T &outX1, T &outX2)
 	return 2;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Float2.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Class that holds 2 floats, used as a storage class mainly.
 class [[nodiscard]] Float2
@@ -29,4 +29,4 @@ public:
 
 static_assert(is_trivial<Float2>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Float3.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Core/HashCombine.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Class that holds 3 floats. Used as a storage class. Convert to Vec3 for calculations.
 class [[nodiscard]] Float3
@@ -40,7 +40,7 @@ using VertexList = vector<Float3>;
 
 static_assert(is_trivial<Float3>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END
 
 // Create a std::hash for Float3
 JPH_MAKE_HASHABLE(JPH::Float3, t.x, t.y, t.z)

+ 2 - 2
Jolt/Math/Float4.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Class that holds 4 float values. Convert to Vec4 to perform calculations.
 class [[nodiscard]] Float4
@@ -27,4 +27,4 @@ public:
 
 static_assert(is_trivial<Float4>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/GaussianElimination.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// This function performs Gauss-Jordan elimination to solve a matrix equation. 
 /// A must be an NxN matrix and B must be an NxM matrix forming the equation A * x = B
@@ -98,4 +98,4 @@ bool GaussianElimination(MatrixA &ioA, MatrixB &ioB, float inTolerance = 1.0e-16
 	return true;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/HalfFloat.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/Vec4.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 using HalfFloat = uint16;
 
@@ -208,4 +208,4 @@ JPH_INLINE Vec4 ToFloat(UVec4Arg inValue)
 
 } // HalfFloatConversion
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Mat44.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/MathTypes.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
 class [[nodiscard]] Mat44
@@ -207,6 +207,6 @@ private:
 
 static_assert(is_trivial<Mat44>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "Mat44.inl"

+ 2 - 2
Jolt/Math/Mat44.inl

@@ -7,7 +7,7 @@
 #include <Jolt/Math/Vec4.h>
 #include <Jolt/Math/Quat.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 Mat44::Mat44(Vec4Arg inC1, Vec4Arg inC2, Vec4Arg inC3, Vec4Arg inC4) : 
 	mCol { inC1, inC2, inC3, inC4 } 
@@ -1094,4 +1094,4 @@ Mat44 Mat44::Decompose(Vec3 &outScale) const
 	return Mat44(Vec4(x / outScale.GetX(), 0), Vec4(y / outScale.GetY(), 0), Vec4(z / outScale.GetZ(), 0), GetColumn4(3));
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Math.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// The constant \f$\pi\f$
 #define JPH_PI       3.14159265358979323846f
@@ -163,4 +163,4 @@ inline uint32 GetNextPowerOf2(uint32 inValue)
 	return inValue <= 1? uint32(1) : uint32(1) << (32 - CountLeadingZeros(inValue - 1));
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/MathTypes.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class Vec3;
 class DVec3;
@@ -24,4 +24,4 @@ using UVec8Arg = UVec8;
 using QuatArg = Quat;
 using Mat44Arg = const Mat44 &;
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Matrix.h

@@ -6,7 +6,7 @@
 #include <Jolt/Math/Vector.h>
 #include <Jolt/Math/GaussianElimination.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Templatized matrix class
 template <uint Rows, uint Cols>
@@ -250,4 +250,4 @@ inline bool Matrix<2, 2>::SetInversed(const Matrix<2, 2> &inM)
 	return true;
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Quat.h

@@ -6,7 +6,7 @@
 #include <Jolt/Math/Vec3.h>
 #include <Jolt/Math/Vec4.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Quaternion class, quaternions are 4 dimensional vectors which can describe rotations in 3 dimensional
 /// space if their length is 1.
@@ -237,6 +237,6 @@ public:
 
 static_assert(is_trivial<Quat>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "Quat.inl"

+ 2 - 2
Jolt/Math/Quat.inl

@@ -1,7 +1,7 @@
 // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
 // SPDX-License-Identifier: MIT
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 Quat Quat::operator * (QuatArg inRHS) const
 { 
@@ -311,4 +311,4 @@ Quat Quat::sLoadFloat3Unsafe(const Float3 &inV)
 	return Quat(Vec4(v, w));
 }
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/Swizzle.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 /// Enum indicating which component to use when swizzling
 enum
@@ -15,4 +15,4 @@ enum
 	SWIZZLE_UNUSED = 2,		///< We always use the Z component when we don't specifically want to initialize a value, this is consistent with what is done in Vec3(x, y, z), Vec3(Float3 &) and Vec3::sLoadFloat3Unsafe
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/UVec4.cpp

@@ -3,7 +3,7 @@
 
 #include <Jolt/Jolt.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 // Table that shifts vector components by 4 - X floats to the left
 const UVec4 UVec4::sFourMinusXShuffle[5] = 
@@ -15,4 +15,4 @@ const UVec4 UVec4::sFourMinusXShuffle[5] =
 	UVec4(0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c)
 };
 
-} // JPH
+JPH_NAMESPACE_END

+ 2 - 2
Jolt/Math/UVec4.h

@@ -5,7 +5,7 @@
 
 #include <Jolt/Math/Vec4.h>
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 class [[nodiscard]] UVec4
 {
@@ -211,6 +211,6 @@ private:
 
 static_assert(is_trivial<UVec4>(), "Is supposed to be a trivial type!");
 
-} // JPH
+JPH_NAMESPACE_END
 
 #include "UVec4.inl"

+ 2 - 2
Jolt/Math/UVec4.inl

@@ -1,7 +1,7 @@
 // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
 // SPDX-License-Identifier: MIT
 
-namespace JPH {
+JPH_NAMESPACE_BEGIN
 
 UVec4::UVec4(uint32 inX, uint32 inY, uint32 inZ, uint32 inW)
 {
@@ -526,4 +526,4 @@ UVec4 UVec4::ShiftComponents4Minus(int inCount) const
 #endif
 }
 
-} // JPH
+JPH_NAMESPACE_END

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels