trying to improve the stuff

This commit is contained in:
2025-12-26 23:59:32 +02:00
parent 352b3b1fc8
commit bf5ca2c23b
9 changed files with 95 additions and 16 deletions

View File

@@ -6,8 +6,6 @@
typedef void *( *CreateInterfaceFn )( const char *szName, int *pReturnCode );
typedef void *( *InstantiateInterfaceFn )( void );
CreateInterfaceFn Plat_GetInterfaceFactory( void *lib );
class CInterfaceRegistry
{
public:
@@ -24,7 +22,16 @@ public:
static void *__Create##className##_interface() { return ( interfaceName* )( new className ); }; \
static CInterfaceRegistry __Create##className##_registry( __Create##className##_interface, versionName );
#define EXPOSE_INTERFACE_FN( functionName, interfaceName, versionName ) \
static CInterfaceRegistry __Create##interfaceName##_registry( functionName, versionName );
#define EXPOSE_INTERFACE_GLOBALVAR( className, interfaceName, versionName, globalVarName ) \
static void *__Create##interfaceName##_interface() { return ( interfaceName* )( &globalVarName ); }; \
static CInterfaceRegistry __Create##interfaceName##_registry( __Create##className##_interface, versionName );
void *CreateInterface( const char *szName, int *pReturnCode );
CreateInterfaceFn Sys_GetFactory( void *pLibrary );
#endif