diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-07-29 20:18:37 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 22:55:15 +0000 |
commit | 64280de4fc1621c1280407acc9e1043043319ca0 (patch) | |
tree | d9e7cb6b88abbcc1ecef045b090a9e1fc0eba696 /src/client | |
parent | 7f1fee44e5cd45cff829951757f5c6460c06cbe8 (diff) |
Change DLL search path order for external libraries that are linked at runtime, like libcurl or libopenal to: * system library paths * executable path * fs_basepath
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/cl_curl.c | 25 | ||||
-rw-r--r-- | src/client/qal.c | 17 |
2 files changed, 8 insertions, 34 deletions
diff --git a/src/client/cl_curl.c b/src/client/cl_curl.c index 63958e38..f8f6580d 100644 --- a/src/client/cl_curl.c +++ b/src/client/cl_curl.c @@ -95,30 +95,19 @@ qboolean CL_cURL_Init() Com_Printf("Loading \"%s\"...", cl_cURLLib->string); - if( (cURLLib = Sys_LoadLibrary(cl_cURLLib->string)) == 0 ) + if(!(cURLLib = Sys_LoadDll(cl_cURLLib->string))) { #ifdef _WIN32 return qfalse; + +#elsif ALTERNATE_CURL_LIB + // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too. + if(!(cURLLib = Sys_LoadDll(ALTERNATE_CURL_LIB))) + return qfalse; #else - char fn[1024]; - - Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) ); - strncat(fn, "/", sizeof(fn)-strlen(fn)-1); - strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1); - - if((cURLLib = Sys_LoadLibrary(fn)) == 0) - { -#ifdef ALTERNATE_CURL_LIB - // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too. - if( (cURLLib = Sys_LoadLibrary(ALTERNATE_CURL_LIB)) == 0 ) - { - return qfalse; - } -#else + return qfalse; #endif - } -#endif /* _WIN32 */ } clc.cURLEnabled = qtrue; diff --git a/src/client/qal.c b/src/client/qal.c index 57db8ed8..68f19b72 100644 --- a/src/client/qal.c +++ b/src/client/qal.c @@ -145,23 +145,8 @@ qboolean QAL_Init(const char *libname) if(OpenALLib) return qtrue; - Com_Printf( "Loading \"%s\"...\n", libname); - if( (OpenALLib = Sys_LoadLibrary(libname)) == 0 ) - { -#ifdef _WIN32 + if(!(OpenALLib = Sys_LoadDll(libname))) return qfalse; -#else - char fn[1024]; - Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) ); - strncat(fn, "/", sizeof(fn) - strlen(fn) - 1); - strncat(fn, libname, sizeof(fn) - strlen(fn) - 1); - - if( (OpenALLib = Sys_LoadLibrary(fn)) == 0 ) - { - return qfalse; - } -#endif - } alinit_fail = qfalse; |