From e11c4e69b10701080249504fa4fd4cfb71215e2b Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Tue, 16 May 2023 14:28:31 -0400 Subject: [PATCH] Really fix convar linking errors --- tier1/convar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tier1/convar.cpp b/tier1/convar.cpp index 05a9dfb7..5290f124 100644 --- a/tier1/convar.cpp +++ b/tier1/convar.cpp @@ -35,9 +35,10 @@ // Statically constructed list of ConCommandBases, // used for registering them with the ICVar interface //----------------------------------------------------------------------------- -class ConCommandRegList; static int64 s_nCVarFlag = 0; static bool s_bRegistered = false; + +class ConCommandRegList; static ConCommandRegList* s_pCmdRegList = nullptr; class ConCommandRegList @@ -106,15 +107,20 @@ private: CUtlVectorFixed m_Vec; ConCommandRegList* m_pNext = nullptr; - static bool ConCommandRegList::s_bConCommandsRegistered; + static bool s_bConCommandsRegistered; }; +bool ConCommandRegList::s_bConCommandsRegistered = false; + #ifdef CONVAR_WORK_FINISHED template void check_size() { static_assert(ExpectedSize == RealSize, "Size mismatch"); }; +class ConVarRegList; +static ConVarRegList* s_pConVarRegList = nullptr; + class ConVarRegList { public: @@ -164,10 +170,10 @@ private: CUtlVectorFixed m_Vec; ConVarRegList* m_pNext = nullptr; - static bool ConVarRegList::s_bConVarsRegistered; + static bool s_bConVarsRegistered; }; -static ConVarRegList* s_pConVarRegList = nullptr; +bool ConVarRegList::s_bConVarsRegistered = false; #endif // CONVAR_WORK_FINISHED //-----------------------------------------------------------------------------