Some MorphOS plugin stuff.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1190 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2005-08-03 13:21:43 +00:00
parent e8e35a4a19
commit 091aa86c94

View file

@ -130,13 +130,23 @@ void Sys_UnloadDLL(void *handle)
}
}
#else
#ifdef __MORPHOS__
#include <proto/dynload.h>
#else
#include <dlfcn.h>
#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);
hVM=NULL;
@ -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)
{