Angst and zinx cajoled me into removing trying to load libcurl.so again.

This commit is contained in:
Thilo Schulz 2008-02-17 13:46:34 +00:00
parent a99634c2d3
commit dc3d2457e0
2 changed files with 12 additions and 17 deletions

View file

@ -101,27 +101,21 @@ qboolean CL_cURL_Init()
#else #else
char fn[1024]; char fn[1024];
// On some linux distributions there is no libcurl.so symlink, but only libcurl.so.4 Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
Q_strncpyz(fn, cl_cURLLib->string, sizeof(fn)); strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);
strncat(fn, ".4", sizeof(fn)-strlen(fn)-1);
if((cURLLib = Sys_LoadLibrary(fn)) == 0) if((cURLLib = Sys_LoadLibrary(fn)) == 0)
{ {
Q_strncpyz(fn, cl_cURLLib->string, sizeof(fn)); #ifdef ALTERNATE_CURL_LIB
strncat(fn, ".3", sizeof(fn)-strlen(fn)-1); // 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 )
if((cURLLib = Sys_LoadLibrary(fn)) == 0)
{ {
Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) ); return qfalse;
strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);
if( (cURLLib = Sys_LoadLibrary(fn)) == 0 )
{
return qfalse;
}
} }
#else
return qfalse;
#endif
} }
#endif /* _WIN32 */ #endif /* _WIN32 */
} }

View file

@ -34,7 +34,8 @@ extern cvar_t *cl_cURLLib;
#elif defined(MACOS_X) #elif defined(MACOS_X)
#define DEFAULT_CURL_LIB "libcurl.dylib" #define DEFAULT_CURL_LIB "libcurl.dylib"
#else #else
#define DEFAULT_CURL_LIB "libcurl.so" #define DEFAULT_CURL_LIB "libcurl.so.4"
#define ALTERNATE_CURL_LIB "libcurl.so.3"
#endif #endif
#ifdef USE_LOCAL_HEADERS #ifdef USE_LOCAL_HEADERS