This commit is contained in:
JusicP
2021-08-21 15:18:30 +03:00
parent 3b4285ab0d
commit af3ceed851
46 changed files with 766 additions and 75 deletions
+15 -4
View File
@@ -304,15 +304,26 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO
#ifdef POSIX
struct stat statBuf;
#ifdef ANDROID
Q_snprintf(szModuleName, sizeof(szModuleName), "lib/lib%s", pModuleName);
#else
Q_snprintf(szModuleName, sizeof(szModuleName), "bin/lib%s", pModuleName);
#endif
bUseLibPrefix |= stat(szModuleName, &statBuf) == 0;
#endif
if( bUseLibPrefix )
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/bin/lib%s", szCwd, pModuleName );
else
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/bin/%s", szCwd, pModuleName );
#ifdef ANDROID
char* szModulePath = "%s/lib/lib%s";
if (!bUseLibPrefix)
szModulePath = "%s/lib/%s";
#else
char* szModulePath = "%s/bin/lib%s";
if (!bUseLibPrefix)
szModulePath = "%s/bin/%s";
#endif
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), szModulePath, szCwd, pModuleName );
hDLL = Sys_LoadLibrary( szAbsoluteModuleName, flags );
}