engine: platform: posix: replace va function calls.

This commit is contained in:
Andrey Akhmichin 2022-12-18 22:07:13 +05:00 committed by Alibek Omarov
parent a2d459ae84
commit b648c74815
1 changed files with 9 additions and 4 deletions

View File

@ -82,6 +82,7 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
{
dll_user_t *hInst = NULL;
void *pHandle = NULL;
char buf[MAX_VA_STRING];
COM_ResetLibraryError();
@ -110,7 +111,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
if( pHandle )
return pHandle;
COM_PushLibraryError( va( "Failed to find library %s", dllname ));
Q_snprintf( buf, sizeof( buf ), "Failed to find library %s", dllname );
COM_PushLibraryError( buf );
COM_PushLibraryError( dlerror() );
return NULL;
}
@ -118,7 +120,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
if( hInst->custom_loader )
{
COM_PushLibraryError( va( "Custom library loader is not available. Extract library %s and fix gameinfo.txt!", hInst->fullPath ));
Q_snprintf( buf, sizeof( buf ), "Custom library loader is not available. Extract library %s and fix gameinfo.txt!", hInst->fullPath );
COM_PushLibraryError( buf );
Mem_Free( hInst );
return NULL;
}
@ -128,14 +131,16 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
{
if( hInst->encrypted )
{
COM_PushLibraryError( va( "Library %s is encrypted. Cannot load", hInst->shortPath ) );
Q_snprintf( buf, sizeof( buf ), "Library %s is encrypted. Cannot load", hInst->shortPath );
COM_PushLibraryError( buf );
Mem_Free( hInst );
return NULL;
}
if( !( hInst->hInstance = Loader_LoadLibrary( hInst->fullPath ) ) )
{
COM_PushLibraryError( va( "Failed to load DLL with DLL loader: %s", hInst->shortPath ) );
Q_snprintf( buf, sizeof( buf ), "Failed to load DLL with DLL loader: %s", hInst->shortPath );
COM_PushLibraryError( buf );
Mem_Free( hInst );
return NULL;
}