Tier0: drop SDK specific code for tools

Mathlib doesn't use some of the game-specific mutex stuff, but since our tools is now also including the mutex utilities, we have to block them out for _TOOLS as well.
This commit is contained in:
Kawe Mazidjatari 2024-07-06 09:33:31 +02:00
parent a03603b0bd
commit f989061e2d
2 changed files with 14 additions and 8 deletions

View File

@ -94,6 +94,7 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES
)
target_compile_definitions( ${PROJECT_NAME} PRIVATE
"WIN32"
"_TOOLS"
)
target_precompile_headers( ${PROJECT_NAME} PRIVATE
"${ENGINE_SOURCE_DIR}/thirdparty/recast/Pch.h"

View File

@ -1,10 +1,15 @@
#ifndef THREADTOOLS_H
#define THREADTOOLS_H
#include "dbg.h"
#ifndef BUILDING_MATHLIB
#include "jobthread.h"
#ifdef BUILDING_MATHLIB
#define _TOOLS
#endif // BUILDING_MATHLIB
#ifndef _TOOLS
#include "jobthread.h"
#endif // _TOOLS
inline void ThreadSleep(unsigned nMilliseconds)
{
#ifdef _WIN32
@ -115,7 +120,7 @@ FORCEINLINE ThreadId_t ThreadGetCurrentId()
#endif
}
#ifndef BUILDING_MATHLIB
#ifndef _TOOLS
extern ThreadId_t* g_ThreadMainThreadID;
extern ThreadId_t* g_ThreadServerFrameThreadID;
@ -128,7 +133,7 @@ PLATFORM_INTERFACE bool ThreadInMainOrServerFrameThread();
PLATFORM_INTERFACE bool ThreadCouldDoServerWork();
PLATFORM_INTERFACE void ThreadJoinServerJob();
#endif // !BUILDING_MATHLIB
#endif // !_TOOLS
#ifdef _WIN32
#define NOINLINE
@ -262,11 +267,11 @@ private:
typedef CInterlockedIntT<int> CInterlockedInt;
typedef CInterlockedIntT<unsigned> CInterlockedUInt;
#ifndef BUILDING_MATHLIB
#ifndef _TOOLS
//=============================================================================
#endif // !BUILDING_MATHLIB
#endif // !_TOOLS
///////////////////////////////////////////////////////////////////////////////
class CThreadFastMutex
@ -557,7 +562,7 @@ void CThreadSpinRWLock::UnlockRead()
#endif
}
#ifndef BUILDING_MATHLIB
#ifndef _TOOLS
///////////////////////////////////////////////////////////////////////////////
class VThreadTools : public IDetour
{
@ -582,5 +587,5 @@ class VThreadTools : public IDetour
};
///////////////////////////////////////////////////////////////////////////////
#endif // !BUILDING_MATHLIB
#endif // !_TOOLS
#endif // THREADTOOLS_H