Go back to the old method. The new one just wasn't helping.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@846 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
dec44590b2
commit
a5f962cbda
1 changed files with 4 additions and 12 deletions
|
@ -66,16 +66,11 @@ struct vm_s {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int (EXPORT_FN *func)(int, ...);
|
|
||||||
} engineexport_t;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "winquake.h"
|
#include "winquake.h"
|
||||||
void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int arg, ... ))
|
void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int arg, ... ))
|
||||||
{
|
{
|
||||||
engineexport_t exp;
|
void (*dllEntry)(int (EXPORT_FN *syscall)(int arg, ... ));
|
||||||
void (*dllEntry)(engineexport_t *);
|
|
||||||
char dllname[MAX_OSPATH];
|
char dllname[MAX_OSPATH];
|
||||||
HINSTANCE hVM;
|
HINSTANCE hVM;
|
||||||
|
|
||||||
|
@ -111,8 +106,7 @@ void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
exp.func = syscall;
|
dllEntry(syscall);
|
||||||
dllEntry(&exp);
|
|
||||||
|
|
||||||
*vmMain=(void *)GetProcAddress(hVM, "vmMain");
|
*vmMain=(void *)GetProcAddress(hVM, "vmMain");
|
||||||
if(!*vmMain)
|
if(!*vmMain)
|
||||||
|
@ -139,8 +133,7 @@ void Sys_UnloadDLL(void *handle)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int arg, ... ))
|
void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int arg, ... ))
|
||||||
{
|
{
|
||||||
engineexport_t exp;
|
void (*dllEntry)(int (EXPORT_FN *syscall)(int arg, ... ));
|
||||||
void (*dllEntry)(engineexport_t *);
|
|
||||||
char dllname[MAX_OSPATH];
|
char dllname[MAX_OSPATH];
|
||||||
void *hVM;
|
void *hVM;
|
||||||
|
|
||||||
|
@ -176,8 +169,7 @@ void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
exp.func = syscall;
|
(*dllEntry)(syscall);
|
||||||
(*dllEntry)(&exp);
|
|
||||||
|
|
||||||
*vmMain=(void *)dlsym(hVM, "vmMain");
|
*vmMain=(void *)dlsym(hVM, "vmMain");
|
||||||
if(!*vmMain)
|
if(!*vmMain)
|
||||||
|
|
Loading…
Reference in a new issue