added forgotten files

This commit is contained in:
2025-12-28 01:53:44 +02:00
parent 9a2ccd9cf0
commit 842eeabbde
25 changed files with 155 additions and 178 deletions
+5 -4
View File
@@ -13,7 +13,6 @@ CUtlVector<CUtlString> tier1_CompiledFiles = {
"tier1/utlstring.cpp",
"tier1/utlvector.cpp",
};
CUtlString tier1_lib;
DECLARE_BUILD_STAGE(tier1)
{
@@ -22,13 +21,15 @@ DECLARE_BUILD_STAGE(tier1)
compileProject.m_szName = "tier1";
compileProject.files = tier1_CompiledFiles;
compileProject.includeDirectories = all_IncludeDirectories;
compileProject.includeDirectories = {"../public"};
compileProject.bFPIC = true;
ldProject = ccompiler->Compile(&compileProject);
ldProject.linkType = ELINK_STATIC_LIBRARY;
CUtlString outputProject = linker->Link(&ldProject);
tier1_lib = outputProject;
CUtlString szOutputDir = linker->Link(&ldProject);
ADD_OUTPUT_LIBRARY(szOutputDir)
return 0;
};
+34
View File
@@ -0,0 +1,34 @@
#include "helper.h"
#include "c.h"
#include "ld.h"
#include "tier1/utlstring.h"
#include "tier1/commandline.h"
CUtlVector<CUtlString> tier1_CompiledFiles = {
"interface.cpp",
"appinit.cpp",
"commandline.cpp",
"utlbuffer.cpp",
"utlmap.cpp",
"utlstring.cpp",
"utlvector.cpp",
};
DECLARE_BUILD_STAGE(tier1)
{
CProject_t compileProject = {};
LinkProject_t ldProject = {};
compileProject.m_szName = "tier1";
compileProject.files = tier1_CompiledFiles;
compileProject.includeDirectories = {"../public"};
compileProject.bFPIC = true;
ldProject = ccompiler->Compile(&compileProject);
ldProject.linkType = ELINK_STATIC_LIBRARY;
CUtlString szOutputDir = linker->Link(&ldProject);
ADD_OUTPUT_LIBRARY(szOutputDir)
return 0;
};
Binary file not shown.
+13 -5
View File
@@ -1,18 +1,23 @@
#include "tier1/interface.h"
#include "tier1/utlvector.h"
#include "dlfcn.h"
static CInterfaceRegistry *s_pInterfaceRegistries;
CInterfaceRegistry *g_pInterfaceRegistries = NULL;
CInterfaceRegistry::CInterfaceRegistry( InstantiateInterfaceFn fn, const char *szName )
: m_szName(szName)
{
m_CreateFn = fn;
m_pNext = g_pInterfaceRegistries;
g_pInterfaceRegistries = this;
m_pNext = s_pInterfaceRegistries;
s_pInterfaceRegistries = this;
Dl_info info = {};
dladdr((void *)&s_pInterfaceRegistries, &info);
printf("%p: %s in %s\n",&s_pInterfaceRegistries, m_szName, info.dli_fname);
};
void *CreateInterface( const char *szName, int *pReturnCode )
DLL_EXPORT void *CreateInterface( const char *szName, int *pReturnCode )
{
CInterfaceRegistry *pRegistry = g_pInterfaceRegistries;
CInterfaceRegistry *pRegistry = s_pInterfaceRegistries;
while (pRegistry)
{
if (!V_strcmp(szName, pRegistry->m_szName))
@@ -30,5 +35,8 @@ void *CreateInterface( const char *szName, int *pReturnCode )
CreateInterfaceFn Sys_GetFactory( void *lib )
{
#ifdef POSIX
return CreateInterface;
#endif
return (CreateInterfaceFn)Plat_GetProc(lib, "CreateInterface");
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.