server: enable dll export on Linux

This commit is contained in:
Alibek Omarov 2023-09-09 04:09:59 +03:00
parent 524f4874a8
commit 382152ca79
3 changed files with 4 additions and 8 deletions

View file

@ -100,7 +100,7 @@ static void SetObjectCollisionBox( entvars_t *pev );
#ifndef _WIN32 #ifndef _WIN32
extern "C" { extern "C" {
#endif #endif
int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ) int DLLEXPORT GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion )
{ {
if ( !pFunctionTable || interfaceVersion != INTERFACE_VERSION ) if ( !pFunctionTable || interfaceVersion != INTERFACE_VERSION )
{ {
@ -111,7 +111,7 @@ int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion )
return TRUE; return TRUE;
} }
int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) int DLLEXPORT GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion )
{ {
if ( !pFunctionTable || *interfaceVersion != INTERFACE_VERSION ) if ( !pFunctionTable || *interfaceVersion != INTERFACE_VERSION )
{ {

View file

@ -57,7 +57,7 @@ void DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t
extern "C" { extern "C" {
void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) void DLLEXPORT GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
{ {
memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t));
gpGlobals = pGlobals; gpGlobals = pGlobals;

View file

@ -85,13 +85,9 @@ typedef int BOOL;
// This is the glue that hooks .MAP entity class names to our CPP classes // This is the glue that hooks .MAP entity class names to our CPP classes
// The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress() // The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress()
// The function is used to intialize / allocate the object for the entity // The function is used to intialize / allocate the object for the entity
#ifdef _WIN32
#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) \ #define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) \
extern "C" _declspec( dllexport ) void mapClassName( entvars_t *pev ); \ extern "C" DLLEXPORT void mapClassName( entvars_t *pev ); \
void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); } void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); }
#else
#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) extern "C" void mapClassName( entvars_t *pev ); void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); }
#endif
// //