From 091aa86c94528c81f68e4774aa84dc356f64d7b3 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Wed, 3 Aug 2005 13:21:43 +0000 Subject: [PATCH] Some MorphOS plugin stuff. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1190 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/qvm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/engine/common/qvm.c b/engine/common/qvm.c index 7c5e8a193..aacab569a 100644 --- a/engine/common/qvm.c +++ b/engine/common/qvm.c @@ -130,12 +130,22 @@ void Sys_UnloadDLL(void *handle) } } #else +#ifdef __MORPHOS__ +#include +#else #include +#endif + void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int arg, ... )) { void (*dllEntry)(int (EXPORT_FN *syscall)(int arg, ... )); char dllname[MAX_OSPATH]; void *hVM; + +#ifdef __MORPHOS__ + if (DynLoadBase == 0) + return 0; +#endif sprintf(dllname, "%sx86.so", name); @@ -151,6 +161,7 @@ void *Sys_LoadDLL(const char *name, void **vmMain, int (EXPORT_FN *syscall)(int if (!gpath) return NULL; // couldn't find one anywhere _snprintf (name, sizeof(name), "%s/%s", gpath, dllname); + hVM = dlopen (name, RTLD_NOW); if (hVM) {