From a03603b0bd0e3a1d7686b139a1727737cc42b3d2 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 6 Jul 2024 09:31:35 +0200 Subject: [PATCH] Tier0: define STATIC_TIER0 This fixes a bunch of linker errors when trying to use tier0 utility code in new projects while not utilizing the rest of the library. We don't need to export the CThreadMutex stuff as everything we build is static. Only the logging functions should be exported, these are therefore using DLL_EXPORT explicitly. --- src/public/tier0/dbg.h | 12 ++++++------ src/public/tier0/platform.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/public/tier0/dbg.h b/src/public/tier0/dbg.h index 14e8fe50..e024bb97 100644 --- a/src/public/tier0/dbg.h +++ b/src/public/tier0/dbg.h @@ -107,10 +107,10 @@ void CoreMsg(LogType_t logType, LogLevel_t logLevel, eDLL_T context, const UINT exitCode, const char* pszLogger, const char* pszFormat, ...); // These functions do not return. -PLATFORM_INTERFACE void Msg(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); -PLATFORM_INTERFACE void NetMsg(LogType_t logType, eDLL_T context, const char* uptime, const char* fmt, ...) FMTFUNCTION(4, 5); -PLATFORM_INTERFACE void Warning(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); -PLATFORM_INTERFACE void Error(eDLL_T context, const UINT code, const char* fmt, ...) FMTFUNCTION(3, 4); +DLL_EXPORT void Msg(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); +DLL_EXPORT void NetMsg(LogType_t logType, eDLL_T context, const char* uptime, const char* fmt, ...) FMTFUNCTION(4, 5); +DLL_EXPORT void Warning(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); +DLL_EXPORT void Error(eDLL_T context, const UINT code, const char* fmt, ...) FMTFUNCTION(3, 4); // TODO[ AMOS ]: export to DLL? void Plat_FatalError(eDLL_T context, const char* fmt, ...); @@ -119,8 +119,8 @@ void Plat_FatalError(eDLL_T context, const char* fmt, ...); #define DevMsg( ... ) ((void)0) #define DevWarning( ... ) ((void)0) #else // DBGFLAG_STRINGS_STRIP -PLATFORM_INTERFACE void DevMsg(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); -PLATFORM_INTERFACE void DevWarning(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); +DLL_EXPORT void DevMsg(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); +DLL_EXPORT void DevWarning(eDLL_T context, const char* fmt, ...) FMTFUNCTION(2, 3); #endif // You can use this macro like a runtime assert macro. diff --git a/src/public/tier0/platform.h b/src/public/tier0/platform.h index 31bb5279..51262870 100644 --- a/src/public/tier0/platform.h +++ b/src/public/tier0/platform.h @@ -13,7 +13,7 @@ #define V_CONSTEXPR #endif -#define TIER0_DLL_EXPORT +#define STATIC_TIER0 #ifdef _MSC_VER #define COMPILER_MSVC 1 // !TODO: Set in CMake!