const char* os;
Memory_Init ();
+ Log_Init ();
COM_InitArgv();
COM_InitGameType();
os = "NetBSD";
#elif defined(__OpenBSD__)
os = "OpenBSD";
+#elif defined(MACOSX)
+ os = "Mac OS X";
#else
os = "Unknown";
#endif
- snprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
+ dpsnprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
// COMMANDLINEOPTION: Console: -nostdout disables text output to the terminal the game was launched from
if (COM_CheckParm("-nostdout"))
===============================================================================
*/
-qboolean Sys_LoadLibrary (const char* dllname, dllhandle_t* handle, const dllfunction_t *fcts)
+qboolean Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts)
{
const dllfunction_t *func;
- dllhandle_t dllhandle;
+ dllhandle_t dllhandle = 0;
+ unsigned int i;
if (handle == NULL)
return false;
for (func = fcts; func && func->name != NULL; func++)
*func->funcvariable = NULL;
- // Load the DLL
+ // Try every possible name
+ for (i = 0; dllnames[i] != NULL; i++)
+ {
#ifdef WIN32
- dllhandle = LoadLibrary (dllname);
+ dllhandle = LoadLibrary (dllnames[i]);
#else
- dllhandle = dlopen (dllname, RTLD_LAZY);
+ dllhandle = dlopen (dllnames[i], RTLD_LAZY);
#endif
+ if (dllhandle)
+ break;
+
+ Con_Printf ("Can't load \"%s\".\n", dllnames[i]);
+ }
+
+ // No DLL found
if (! dllhandle)
- {
- Con_Printf ("Can't load \"%s\".\n", dllname);
return false;
- }
+
+ Con_Printf("\"%s\" loaded.\n", dllnames[i]);
// Get the function adresses
for (func = fcts; func && func->name != NULL; func++)
}
*handle = dllhandle;
- Con_Printf("\"%s\" loaded.\n", dllname);
return true;
}