Browse Source

Switch from using _DEBUG to NDEBUG (#1049)

NDEBUG is defined in the standard while _DEBUG is Visual Studio specific.
Jorrit Rouwe 1 year ago
parent
commit
76eb4534be

+ 1 - 1
Jolt/ConfigurationString.h

@@ -62,7 +62,7 @@ inline const char *GetConfigurationString()
 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
 #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
 		"(FP Exceptions) "
 		"(FP Exceptions) "
 #endif
 #endif
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 		"(Debug) "
 		"(Debug) "
 #endif
 #endif
 		;
 		;

+ 7 - 2
Jolt/Core/Core.h

@@ -478,8 +478,13 @@ static_assert(sizeof(void *) == (JPH_CPU_ADDRESS_BITS == 64? 8 : 4), "Invalid si
 // Stack allocation
 // Stack allocation
 #define JPH_STACK_ALLOC(n)		alloca(n)
 #define JPH_STACK_ALLOC(n)		alloca(n)
 
 
-// Shorthand for #ifdef _DEBUG / #endif
-#ifdef _DEBUG
+// Determine if we want extra debugging code to be active
+#if !defined(NDEBUG) && !defined(JPH_NO_DEBUG)
+	#define JPH_DEBUG
+#endif
+
+// Shorthand for #ifdef JPH_DEBUG / #endif
+#ifdef JPH_DEBUG
 	#define JPH_IF_DEBUG(...)	__VA_ARGS__
 	#define JPH_IF_DEBUG(...)	__VA_ARGS__
 	#define JPH_IF_NOT_DEBUG(...)
 	#define JPH_IF_NOT_DEBUG(...)
 #else
 #else

+ 1 - 1
Jolt/Core/IssueReporting.h

@@ -11,7 +11,7 @@ using TraceFunction = void (*)(const char *inFMT, ...);
 JPH_EXPORT extern TraceFunction Trace;
 JPH_EXPORT extern TraceFunction Trace;
 
 
 // Always turn on asserts in Debug mode
 // Always turn on asserts in Debug mode
-#if defined(_DEBUG) && !defined(JPH_ENABLE_ASSERTS)
+#if defined(JPH_DEBUG) && !defined(JPH_ENABLE_ASSERTS)
 	#define JPH_ENABLE_ASSERTS
 	#define JPH_ENABLE_ASSERTS
 #endif
 #endif
 
 

+ 1 - 1
Jolt/Core/LockFreeHashMap.h

@@ -160,7 +160,7 @@ public:
 	Iterator				begin();
 	Iterator				begin();
 	Iterator				end();
 	Iterator				end();
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	/// Output stats about this map to the log
 	/// Output stats about this map to the log
 	void					TraceStats() const;
 	void					TraceStats() const;
 #endif
 #endif

+ 2 - 2
Jolt/Core/LockFreeHashMap.inl

@@ -189,7 +189,7 @@ inline typename LockFreeHashMap<Key, Value>::KeyValue *LockFreeHashMap<Key, Valu
 	// Construct the key/value pair
 	// Construct the key/value pair
 	KeyValue *kv = mAllocator.template FromOffset<KeyValue>(write_offset);
 	KeyValue *kv = mAllocator.template FromOffset<KeyValue>(write_offset);
 	JPH_ASSERT(intptr_t(kv) % alignof(KeyValue) == 0);
 	JPH_ASSERT(intptr_t(kv) % alignof(KeyValue) == 0);
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	memset(kv, 0xcd, size);
 	memset(kv, 0xcd, size);
 #endif
 #endif
 	kv->mKey = inKey;
 	kv->mKey = inKey;
@@ -311,7 +311,7 @@ typename LockFreeHashMap<Key, Value>::Iterator &LockFreeHashMap<Key, Value>::Ite
 	}
 	}
 }
 }
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 
 
 template <class Key, class Value>
 template <class Key, class Value>
 void LockFreeHashMap<Key, Value>::TraceStats() const
 void LockFreeHashMap<Key, Value>::TraceStats() const

+ 1 - 1
Jolt/Geometry/EPAConvexHullBuilder.h

@@ -152,7 +152,7 @@ public:
 		{
 		{
 			// Destruct triangle
 			// Destruct triangle
 			inT->~Triangle();
 			inT->~Triangle();
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 			memset(inT, 0xcd, sizeof(Triangle));
 			memset(inT, 0xcd, sizeof(Triangle));
 #endif
 #endif
 
 

+ 2 - 2
Jolt/Geometry/GJKClosestPoint.h

@@ -192,7 +192,7 @@ private:
 			break;
 			break;
 
 
 		case 4:
 		case 4:
-		#ifdef _DEBUG
+		#ifdef JPH_DEBUG
 			memset(&outPointA, 0xcd, sizeof(outPointA));
 			memset(&outPointA, 0xcd, sizeof(outPointA));
 			memset(&outPointB, 0xcd, sizeof(outPointB));
 			memset(&outPointB, 0xcd, sizeof(outPointB));
 		#endif
 		#endif
@@ -393,7 +393,7 @@ public:
 #ifdef JPH_GJK_DEBUG
 #ifdef JPH_GJK_DEBUG
 				Trace("Distance bigger than max");
 				Trace("Distance bigger than max");
 #endif
 #endif
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 				memset(&outPointA, 0xcd, sizeof(outPointA));
 				memset(&outPointA, 0xcd, sizeof(outPointA));
 				memset(&outPointB, 0xcd, sizeof(outPointB));
 				memset(&outPointB, 0xcd, sizeof(outPointB));
 #endif
 #endif

+ 8 - 8
Jolt/Physics/Body/BodyManager.cpp

@@ -412,7 +412,7 @@ Body *BodyManager::RemoveBodyInternal(const BodyID &inBodyID)
 	return body;
 	return body;
 }
 }
 
 
-#if defined(_DEBUG) && defined(JPH_ENABLE_ASSERTS)
+#if defined(JPH_DEBUG) && defined(JPH_ENABLE_ASSERTS)
 
 
 void BodyManager::ValidateFreeList() const
 void BodyManager::ValidateFreeList() const
 {
 {
@@ -426,7 +426,7 @@ void BodyManager::ValidateFreeList() const
 	JPH_ASSERT(mNumBodies == mBodies.size() - num_freed);
 	JPH_ASSERT(mNumBodies == mBodies.size() - num_freed);
 }
 }
 
 
-#endif // defined(_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
+#endif // defined(JPH_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
 
 
 void BodyManager::RemoveBodies(const BodyID *inBodyIDs, int inNumber, Body **outBodies)
 void BodyManager::RemoveBodies(const BodyID *inBodyIDs, int inNumber, Body **outBodies)
 {
 {
@@ -456,9 +456,9 @@ void BodyManager::RemoveBodies(const BodyID *inBodyIDs, int inNumber, Body **out
 		}
 		}
 	}
 	}
 
 
-#if defined(_DEBUG) && defined(JPH_ENABLE_ASSERTS)
+#if defined(JPH_DEBUG) && defined(JPH_ENABLE_ASSERTS)
 	ValidateFreeList();
 	ValidateFreeList();
-#endif // defined(_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
+#endif // defined(JPH_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
 }
 }
 
 
 void BodyManager::DestroyBodies(const BodyID *inBodyIDs, int inNumber)
 void BodyManager::DestroyBodies(const BodyID *inBodyIDs, int inNumber)
@@ -482,9 +482,9 @@ void BodyManager::DestroyBodies(const BodyID *inBodyIDs, int inNumber)
 		sDeleteBody(body);
 		sDeleteBody(body);
 	}
 	}
 
 
-#if defined(_DEBUG) && defined(JPH_ENABLE_ASSERTS)
+#if defined(JPH_DEBUG) && defined(JPH_ENABLE_ASSERTS)
 	ValidateFreeList();
 	ValidateFreeList();
-#endif // defined(_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
+#endif // defined(JPH_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
 }
 }
 
 
 void BodyManager::AddBodyToActiveBodies(Body &ioBody)
 void BodyManager::AddBodyToActiveBodies(Body &ioBody)
@@ -1130,7 +1130,7 @@ void BodyManager::ValidateContactCacheForAllBodies()
 	mBodiesCacheInvalid.clear();
 	mBodiesCacheInvalid.clear();
 }
 }
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 void BodyManager::ValidateActiveBodyBounds()
 void BodyManager::ValidateActiveBodyBounds()
 {
 {
 	UniqueLock lock(mActiveBodiesMutex JPH_IF_ENABLE_ASSERTS(, this, EPhysicsLockTypes::ActiveBodiesList));
 	UniqueLock lock(mActiveBodiesMutex JPH_IF_ENABLE_ASSERTS(, this, EPhysicsLockTypes::ActiveBodiesList));
@@ -1144,6 +1144,6 @@ void BodyManager::ValidateActiveBodyBounds()
 			JPH_ASSERT(cached == calculated);
 			JPH_ASSERT(cached == calculated);
 		}
 		}
 }
 }
-#endif // _DEBUG
+#endif // JPH_DEBUG
 
 
 JPH_NAMESPACE_END
 JPH_NAMESPACE_END

+ 4 - 4
Jolt/Physics/Body/BodyManager.h

@@ -275,10 +275,10 @@ public:
 	};
 	};
 #endif
 #endif
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	/// Validate if the cached bounding boxes are correct for all active bodies
 	/// Validate if the cached bounding boxes are correct for all active bodies
 	void							ValidateActiveBodyBounds();
 	void							ValidateActiveBodyBounds();
-#endif // _DEBUG
+#endif // JPH_DEBUG
 
 
 private:
 private:
 	/// Increment and get the sequence number of the body
 	/// Increment and get the sequence number of the body
@@ -299,10 +299,10 @@ private:
 	/// Helper function to delete a body (which could actually be a BodyWithMotionProperties)
 	/// Helper function to delete a body (which could actually be a BodyWithMotionProperties)
 	inline static void				sDeleteBody(Body *inBody);
 	inline static void				sDeleteBody(Body *inBody);
 
 
-#if defined(_DEBUG) && defined(JPH_ENABLE_ASSERTS)
+#if defined(JPH_DEBUG) && defined(JPH_ENABLE_ASSERTS)
 	/// Function to check that the free list is not corrupted
 	/// Function to check that the free list is not corrupted
 	void							ValidateFreeList() const;
 	void							ValidateFreeList() const;
-#endif // defined(_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
+#endif // defined(JPH_DEBUG) && _defined(JPH_ENABLE_ASSERTS)
 
 
 	/// List of pointers to all bodies. Contains invalid pointers for deleted bodies, check with sIsValidBodyPointer. Note that this array is reserved to the max bodies that is passed in the Init function so that adding bodies will not reallocate the array.
 	/// List of pointers to all bodies. Contains invalid pointers for deleted bodies, check with sIsValidBodyPointer. Note that this array is reserved to the max bodies that is passed in the Init function so that adding bodies will not reallocate the array.
 	BodyVector						mBodies;
 	BodyVector						mBodies;

+ 4 - 4
Jolt/Physics/Collision/BroadPhase/QuadTree.cpp

@@ -253,7 +253,7 @@ void QuadTree::UpdatePrepare(const BodyVector &inBodies, TrackingVector &ioTrack
 #endif
 #endif
 
 
 	// Assert sane data
 	// Assert sane data
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	ValidateTree(inBodies, ioTracking, root_node.mIndex, mNumBodies);
 	ValidateTree(inBodies, ioTracking, root_node.mIndex, mNumBodies);
 #endif
 #endif
 
 
@@ -386,7 +386,7 @@ void QuadTree::UpdateFinalize([[maybe_unused]] const BodyVector &inBodies, [[may
 	DumpTree(new_root_node.GetNodeID(), StringFormat("%s_POST", mName).c_str());
 	DumpTree(new_root_node.GetNodeID(), StringFormat("%s_POST", mName).c_str());
 #endif
 #endif
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	ValidateTree(inBodies, inTracking, new_root_node.mIndex, mNumBodies);
 	ValidateTree(inBodies, inTracking, new_root_node.mIndex, mNumBodies);
 #endif
 #endif
 }
 }
@@ -801,7 +801,7 @@ void QuadTree::AddBodiesPrepare(const BodyVector &inBodies, TrackingVector &ioTr
 	// so they will stay together as a batch and will make the tree rebuild cheaper
 	// so they will stay together as a batch and will make the tree rebuild cheaper
 	outState.mLeafID = BuildTree(inBodies, ioTracking, (NodeID *)ioBodyIDs, inNumber, 0, outState.mLeafBounds);
 	outState.mLeafID = BuildTree(inBodies, ioTracking, (NodeID *)ioBodyIDs, inNumber, 0, outState.mLeafBounds);
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	if (outState.mLeafID.IsNode())
 	if (outState.mLeafID.IsNode())
 		ValidateTree(inBodies, ioTracking, outState.mLeafID.GetNodeIndex(), inNumber);
 		ValidateTree(inBodies, ioTracking, outState.mLeafID.GetNodeIndex(), inNumber);
 #endif
 #endif
@@ -1454,7 +1454,7 @@ void QuadTree::FindCollidingPairs(const BodyVector &inBodies, const BodyID *inAc
 	JPH_ASSERT(&root_node == &GetCurrentRoot());
 	JPH_ASSERT(&root_node == &GetCurrentRoot());
 }
 }
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 
 
 void QuadTree::ValidateTree(const BodyVector &inBodies, const TrackingVector &inTracking, uint32 inNodeIndex, uint32 inNumExpectedBodies) const
 void QuadTree::ValidateTree(const BodyVector &inBodies, const TrackingVector &inTracking, uint32 inNodeIndex, uint32 inNumExpectedBodies) const
 {
 {

+ 1 - 1
Jolt/Physics/Collision/BroadPhase/QuadTree.h

@@ -314,7 +314,7 @@ private:
 	/// After the function returns ioNodeIDs and ioNodeCenters will be shuffled
 	/// After the function returns ioNodeIDs and ioNodeCenters will be shuffled
 	static void					sPartition4(NodeID *ioNodeIDs, Vec3 *ioNodeCenters, int inBegin, int inEnd, int *outSplit);
 	static void					sPartition4(NodeID *ioNodeIDs, Vec3 *ioNodeCenters, int inBegin, int inEnd, int *outSplit);
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	/// Validate that the tree is consistent.
 	/// Validate that the tree is consistent.
 	/// Note: This function only works if the tree is not modified while we're traversing it.
 	/// Note: This function only works if the tree is not modified while we're traversing it.
 	void						ValidateTree(const BodyVector &inBodies, const TrackingVector &inTracking, uint32 inNodeIndex, uint32 inNumExpectedBodies) const;
 	void						ValidateTree(const BodyVector &inBodies, const TrackingVector &inTracking, uint32 inNodeIndex, uint32 inNumExpectedBodies) const;

+ 2 - 2
Jolt/Physics/Constraints/ConstraintPart/AxisConstraintPart.h

@@ -86,7 +86,7 @@ class AxisConstraintPart
 		}
 		}
 		else
 		else
 		{
 		{
-		#ifdef _DEBUG
+		#ifdef JPH_DEBUG
 			Vec3::sNaN().StoreFloat3(&mR1PlusUxAxis);
 			Vec3::sNaN().StoreFloat3(&mR1PlusUxAxis);
 		#endif
 		#endif
 		}
 		}
@@ -99,7 +99,7 @@ class AxisConstraintPart
 		}
 		}
 		else
 		else
 		{
 		{
-		#ifdef _DEBUG
+		#ifdef JPH_DEBUG
 			Vec3::sNaN().StoreFloat3(&mR2xAxis);
 			Vec3::sNaN().StoreFloat3(&mR2xAxis);
 		#endif
 		#endif
 		}
 		}

+ 2 - 2
Jolt/Physics/LargeIslandSplitter.cpp

@@ -447,7 +447,7 @@ bool LargeIslandSplitter::SplitIsland(uint32 inIslandIndex, const IslandBuilder
 		JPH_ASSERT(constraint_buffer_cur[s] == mContactAndConstraintIndices + split.mConstraintBufferEnd);
 		JPH_ASSERT(constraint_buffer_cur[s] == mContactAndConstraintIndices + split.mConstraintBufferEnd);
 	}
 	}
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	// Validate that the splits are indeed not touching the same body
 	// Validate that the splits are indeed not touching the same body
 	for (uint s = 0; s < splits.mNumSplits; ++s)
 	for (uint s = 0; s < splits.mNumSplits; ++s)
 	{
 	{
@@ -476,7 +476,7 @@ bool LargeIslandSplitter::SplitIsland(uint32 inIslandIndex, const IslandBuilder
 			}
 			}
 		}
 		}
 	}
 	}
-#endif // _DEBUG
+#endif // JPH_DEBUG
 #endif // JPH_ENABLE_ASSERTS
 #endif // JPH_ENABLE_ASSERTS
 
 
 	// Allow other threads to pick up this split island now
 	// Allow other threads to pick up this split island now

+ 4 - 4
Jolt/Physics/PhysicsSystem.cpp

@@ -387,10 +387,10 @@ EPhysicsUpdateError PhysicsSystem::Update(float inDeltaTime, int inCollisionStep
 				PhysicsUpdateContext::Step *next_step = &context.mSteps[step_idx + 1];
 				PhysicsUpdateContext::Step *next_step = &context.mSteps[step_idx + 1];
 				step.mStartNextStep = inJobSystem->CreateJob("StartNextStep", cColorStartNextStep, [this, next_step]()
 				step.mStartNextStep = inJobSystem->CreateJob("StartNextStep", cColorStartNextStep, [this, next_step]()
 					{
 					{
-					#ifdef _DEBUG
+					#ifdef JPH_DEBUG
 						// Validate that the cached bounds are correct
 						// Validate that the cached bounds are correct
 						mBodyManager.ValidateActiveBodyBounds();
 						mBodyManager.ValidateActiveBodyBounds();
-					#endif // _DEBUG
+					#endif // JPH_DEBUG
 
 
 						// Store the number of active bodies at the start of the step
 						// Store the number of active bodies at the start of the step
 						next_step->mNumActiveBodiesAtStepStart = mBodyManager.GetNumActiveBodies(EBodyType::RigidBody);
 						next_step->mNumActiveBodiesAtStepStart = mBodyManager.GetNumActiveBodies(EBodyType::RigidBody);
@@ -568,10 +568,10 @@ EPhysicsUpdateError PhysicsSystem::Update(float inDeltaTime, int inCollisionStep
 	// We're done with the barrier for this update
 	// We're done with the barrier for this update
 	inJobSystem->DestroyBarrier(barrier);
 	inJobSystem->DestroyBarrier(barrier);
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	// Validate that the cached bounds are correct
 	// Validate that the cached bounds are correct
 	mBodyManager.ValidateActiveBodyBounds();
 	mBodyManager.ValidateActiveBodyBounds();
-#endif // _DEBUG
+#endif // JPH_DEBUG
 
 
 	// Clear the large island splitter
 	// Clear the large island splitter
 	mLargeIslandSplitter.Reset(inTempAllocator);
 	mLargeIslandSplitter.Reset(inTempAllocator);

+ 1 - 1
Samples/Tests/ConvexCollision/RandomRayTest.cpp

@@ -34,7 +34,7 @@ void RandomRayTest::TestRay(const char *inTestName, RVec3Arg inRenderOffset, con
 	default_random_engine random(12345);
 	default_random_engine random(12345);
 	uniform_real_distribution<float> random_scale(-2.0f, 2.0f);
 	uniform_real_distribution<float> random_scale(-2.0f, 2.0f);
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	const int count = 1000;
 	const int count = 1000;
 #else
 #else
 	const int count = 10000;
 	const int count = 10000;

+ 2 - 2
Samples/Tests/General/MultithreadedTest.cpp

@@ -66,7 +66,7 @@ void MultithreadedTest::BoxSpawner()
 {
 {
 	JPH_PROFILE_THREAD_START("BoxSpawner");
 	JPH_PROFILE_THREAD_START("BoxSpawner");
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	const int cMaxObjects = 100;
 	const int cMaxObjects = 100;
 #else
 #else
 	const int cMaxObjects = 1000;
 	const int cMaxObjects = 1000;
@@ -129,7 +129,7 @@ void MultithreadedTest::RagdollSpawner()
 {
 {
 	JPH_PROFILE_THREAD_START("RagdollSpawner");
 	JPH_PROFILE_THREAD_START("RagdollSpawner");
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	const int cMaxRagdolls = 10;
 	const int cMaxRagdolls = 10;
 #else
 #else
 	const int cMaxRagdolls = 50;
 	const int cMaxRagdolls = 50;

+ 1 - 1
Samples/Tests/Rig/RigPileTest.cpp

@@ -32,7 +32,7 @@ const char *RigPileTest::sScenes[] =
 	"Terrain2",
 	"Terrain2",
 };
 };
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	const char *RigPileTest::sSceneName = "PerlinMesh";
 	const char *RigPileTest::sSceneName = "PerlinMesh";
 	int RigPileTest::sPileSize = 5;
 	int RigPileTest::sPileSize = 5;
 	int RigPileTest::sNumPilesPerAxis = 2;
 	int RigPileTest::sNumPilesPerAxis = 2;

+ 1 - 1
Samples/Tests/Test.cpp

@@ -106,7 +106,7 @@ Body &Test::CreateMeshTerrain()
 {
 {
 	const float scale = GetWorldScale();
 	const float scale = GetWorldScale();
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	const int n = 50;
 	const int n = 50;
 	const float cell_size = scale * 2.0f;
 	const float cell_size = scale * 2.0f;
 #else
 #else

+ 6 - 6
TestFramework/Renderer/Renderer.cpp

@@ -13,7 +13,7 @@
 
 
 #include <d3dcompiler.h>
 #include <d3dcompiler.h>
 #include <shellscalingapi.h>
 #include <shellscalingapi.h>
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	#include <d3d12sdklayers.h>
 	#include <d3d12sdklayers.h>
 #endif
 #endif
 
 
@@ -189,7 +189,7 @@ void Renderer::Initialize()
 	// Show window
 	// Show window
 	ShowWindow(mhWnd, SW_SHOW);
 	ShowWindow(mhWnd, SW_SHOW);
 
 
-#if defined(_DEBUG)
+#if defined(JPH_DEBUG)
 	// Enable the D3D12 debug layer
 	// Enable the D3D12 debug layer
 	ComPtr<ID3D12Debug> debug_controller;
 	ComPtr<ID3D12Debug> debug_controller;
 	if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debug_controller))))
 	if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debug_controller))))
@@ -245,7 +245,7 @@ void Renderer::Initialize()
 	// Check if we managed to obtain a device
 	// Check if we managed to obtain a device
 	FatalErrorIfFailed(result);
 	FatalErrorIfFailed(result);
 
 
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	// Enable breaking on errors
 	// Enable breaking on errors
 	ComPtr<ID3D12InfoQueue> info_queue;
 	ComPtr<ID3D12InfoQueue> info_queue;
 	if (SUCCEEDED(mDevice.As(&info_queue)))
 	if (SUCCEEDED(mDevice.As(&info_queue)))
@@ -265,7 +265,7 @@ void Renderer::Initialize()
 		filter.DenyList.pIDList = hide;
 		filter.DenyList.pIDList = hide;
 		info_queue->AddStorageFilterEntries( &filter );
 		info_queue->AddStorageFilterEntries( &filter );
 	}
 	}
-#endif // _DEBUG
+#endif // JPH_DEBUG
 
 
 	// Disable full screen transitions
 	// Disable full screen transitions
 	FatalErrorIfFailed(mDXGIFactory->MakeWindowAssociation(mhWnd, DXGI_MWA_NO_ALT_ENTER));
 	FatalErrorIfFailed(mDXGIFactory->MakeWindowAssociation(mhWnd, DXGI_MWA_NO_ALT_ENTER));
@@ -656,7 +656,7 @@ void Renderer::SetRenderTarget(Texture *inRenderTarget)
 ComPtr<ID3DBlob> Renderer::CreateVertexShader(const char *inFileName)
 ComPtr<ID3DBlob> Renderer::CreateVertexShader(const char *inFileName)
 {
 {
 	UINT flags = D3DCOMPILE_ENABLE_STRICTNESS;
 	UINT flags = D3DCOMPILE_ENABLE_STRICTNESS;
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	flags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
 	flags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
 #endif
 #endif
 
 
@@ -695,7 +695,7 @@ ComPtr<ID3DBlob> Renderer::CreateVertexShader(const char *inFileName)
 ComPtr<ID3DBlob> Renderer::CreatePixelShader(const char *inFileName)
 ComPtr<ID3DBlob> Renderer::CreatePixelShader(const char *inFileName)
 {
 {
 	UINT flags = D3DCOMPILE_ENABLE_STRICTNESS;
 	UINT flags = D3DCOMPILE_ENABLE_STRICTNESS;
-#ifdef _DEBUG
+#ifdef JPH_DEBUG
 	flags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
 	flags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
 #endif
 #endif