mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 11:35:05 +08:00
filesystem: allow acquiring C interface through CreateInterface export
This commit is contained in:
@@ -492,6 +492,18 @@ extern "C" void EXPORT *CreateInterface( const char *interface, int *retval )
|
||||
return &g_VFileSystem009;
|
||||
}
|
||||
|
||||
if( !Q_strcmp( interface, FS_API_CREATEINTERFACE_TAG ))
|
||||
{
|
||||
// return a copy, to disallow overriding
|
||||
static fs_api_t copy = { 0 };
|
||||
|
||||
if( !copy.InitStdio )
|
||||
memcpy( ©, &g_api, sizeof( copy ));
|
||||
|
||||
if( retval ) *retval = 0;
|
||||
return ©
|
||||
}
|
||||
|
||||
if( retval ) *retval = 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user