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:
Spoike 2009-11-15 03:13:48 +00:00
parent acc77b4f36
commit c79dfc7d4f

View file

@ -73,7 +73,8 @@ struct vm_s {
dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall) dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
{ {
void (EXPORT_FN *dllEntry)(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; dllhandle_t *hVM;
dllfunction_t funcs[] = dllfunction_t funcs[] =
@ -89,17 +90,23 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
#endif #endif
#ifdef _WIN32 #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__) #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__) #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__) #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__) #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 #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 #endif
hVM=NULL; hVM=NULL;
@ -114,7 +121,7 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
if (!gpath) if (!gpath)
return NULL; // couldn't find one anywhere 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); Con_DPrintf("Loading native: %s\n", fname);
hVM = Sys_LoadLibrary(fname, funcs); hVM = Sys_LoadLibrary(fname, funcs);
@ -123,7 +130,7 @@ dllhandle_t *QVM_LoadDLL(const char *name, void **vmMain, sys_calldll_t syscall)
break; 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); Con_DPrintf("Loading native: %s\n", fname);
hVM = Sys_LoadLibrary(fname, funcs); hVM = Sys_LoadLibrary(fname, funcs);