Browse Source

engine: platform: posix: replace va function calls.

pull/2/head
Andrey Akhmichin 2 years ago committed by Alibek Omarov
parent
commit
b648c74815
  1. 13
      engine/platform/posix/lib_posix.c

13
engine/platform/posix/lib_posix.c

@ -82,6 +82,7 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d @@ -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 @@ -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 @@ -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 @@ -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;
}

Loading…
Cancel
Save