1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-05 17:13:36 +08:00

Really fix convar linking errors

This commit is contained in:
Nick Hastings 2023-05-16 14:28:31 -04:00 committed by Nicholas Hastings
parent fba263ab37
commit e11c4e69b1

View File

@ -35,9 +35,10 @@
// Statically constructed list of ConCommandBases, // Statically constructed list of ConCommandBases,
// used for registering them with the ICVar interface // used for registering them with the ICVar interface
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class ConCommandRegList;
static int64 s_nCVarFlag = 0; static int64 s_nCVarFlag = 0;
static bool s_bRegistered = false; static bool s_bRegistered = false;
class ConCommandRegList;
static ConCommandRegList* s_pCmdRegList = nullptr; static ConCommandRegList* s_pCmdRegList = nullptr;
class ConCommandRegList class ConCommandRegList
@ -106,15 +107,20 @@ private:
CUtlVectorFixed<ConCommand, 100> m_Vec; CUtlVectorFixed<ConCommand, 100> m_Vec;
ConCommandRegList* m_pNext = nullptr; ConCommandRegList* m_pNext = nullptr;
static bool ConCommandRegList::s_bConCommandsRegistered; static bool s_bConCommandsRegistered;
}; };
bool ConCommandRegList::s_bConCommandsRegistered = false;
#ifdef CONVAR_WORK_FINISHED #ifdef CONVAR_WORK_FINISHED
template <typename ToCheck, std::size_t ExpectedSize, std::size_t RealSize = sizeof(ToCheck)> template <typename ToCheck, std::size_t ExpectedSize, std::size_t RealSize = sizeof(ToCheck)>
void check_size() { void check_size() {
static_assert(ExpectedSize == RealSize, "Size mismatch"); static_assert(ExpectedSize == RealSize, "Size mismatch");
}; };
class ConVarRegList;
static ConVarRegList* s_pConVarRegList = nullptr;
class ConVarRegList class ConVarRegList
{ {
public: public:
@ -164,10 +170,10 @@ private:
CUtlVectorFixed<ConVar, 100> m_Vec; CUtlVectorFixed<ConVar, 100> m_Vec;
ConVarRegList* m_pNext = nullptr; 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 #endif // CONVAR_WORK_FINISHED
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------