Small tweek that means ktx is more likely to load properly, and without renaming anything weirdly.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3454 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
acc77b4f36
commit
c79dfc7d4f
1 changed files with 16 additions and 9 deletions
|
@ -73,7 +73,8 @@ struct vm_s {
|
|||
dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
|
||||
{
|
||||
void (EXPORT_FN *dllEntry)(sys_calldll_t syscall);
|
||||
char dllname[MAX_OSPATH];
|
||||
char dllname_arch[MAX_OSPATH]; //id compatible
|
||||
char dllname_anycpu[MAX_OSPATH];//simple
|
||||
dllhandle_t *hVM;
|
||||
|
||||
dllfunction_t funcs[] =
|
||||
|
@ -89,17 +90,23 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
sprintf(dllname, "%sx86.dll", name);
|
||||
snprintf(dllname_arch, sizeof(dllname_arch), "%sx86.dll", name);
|
||||
snprintf(dllname_anycpu, sizeof(dllname_anycpu), "%s.dll", name);
|
||||
#elif defined(__amd64__)
|
||||
sprintf(dllname, "%samd.so", name);
|
||||
snprintf(dllname_arch, sizeof(dllname_arch), "%samd.so", name);
|
||||
snprintf(dllname_anycpu, sizeof(dllname_anycpu), "%s.so", name);
|
||||
#elif defined(_M_IX86) || defined(__i386__)
|
||||
sprintf(dllname, "%sx86.so", name);
|
||||
snprintf(dllname_arch, sizeof(dllname_arch), "%sx86.so", name);
|
||||
snprintf(dllname_anycpu, sizeof(dllname_anycpu), "%s.so", name);
|
||||
#elif defined(__powerpc__)
|
||||
sprintf(dllname, "%sppc.so", name);
|
||||
snprintf(dllname_arch, sizeof(dllname_arch), "%sppc.so", name);
|
||||
snprintf(dllname_anycpu, sizeof(dllname_anycpu), "%s.so", name);
|
||||
#elif defined(__ppc__)
|
||||
sprintf(dllname, "%sppc.so", name);
|
||||
snprintf(dllname_arch, sizeof(dllname_arch), "%sppc.so", name);
|
||||
snprintf(dllname_anycpu, sizeof(dllname_anycpu), "%s.so", name);
|
||||
#else
|
||||
sprintf(dllname, "%sunk.so", name);
|
||||
snprintf(dllname_arch, sizeof(dllname_arch), "%sunk.so", name);
|
||||
snprintf(dllname_anycpu, sizeof(dllname_anycpu), "%s.so", name);
|
||||
#endif
|
||||
|
||||
hVM=NULL;
|
||||
|
@ -114,7 +121,7 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
|
|||
if (!gpath)
|
||||
return NULL; // couldn't find one anywhere
|
||||
|
||||
snprintf (fname, sizeof(fname), "%s/%s", gpath, dllname);
|
||||
snprintf (fname, sizeof(fname), "%s/%s", gpath, dllname_arch);
|
||||
|
||||
Con_DPrintf("Loading native: %s\n", fname);
|
||||
hVM = Sys_LoadLibrary(fname, funcs);
|
||||
|
@ -123,7 +130,7 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
|
|||
break;
|
||||
}
|
||||
|
||||
snprintf (fname, sizeof(fname), "%s/%s", gpath, name);
|
||||
snprintf (fname, sizeof(fname), "%s/%s", gpath, dllname_anycpu);
|
||||
|
||||
Con_DPrintf("Loading native: %s\n", fname);
|
||||
hVM = Sys_LoadLibrary(fname, funcs);
|
||||
|
|
Loading…
Reference in a new issue