* Plugin support for Win32.

git-svn-id: svn://svn.zoy.org/elk/trunk@150 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2003-09-13 06:31:24 +00:00
parent 1b2f8598a4
commit d4dc463b3d
2 changed files with 18 additions and 1 deletions

View File

@ -6,12 +6,13 @@ AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(autotools)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(elk, 3.99.2-cvs)
AM_INIT_AUTOMAKE(elk, 3.99.2)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_STDC_HEADERS

View File

@ -92,6 +92,19 @@ void Dlopen_File (char *fn) {
/* NSUnLinkModule (handle, FALSE); */
#elif defined(WIN32)
void *handle;
if (Verb_Load)
printf ("[dll %s]\n", fn);
handle = LoadLibrary (fn);
if (handle == NULL) {
Primitive_Error ("LoadLibrary failed on ~%~s",
Make_String (fn, strlen (fn)));
}
#elif defined(HAVE_DL_DLOPEN)
void *handle;
@ -140,6 +153,9 @@ void Dlopen_File (char *fn) {
if (sym)
sp->value = (unsigned long int)(intptr_t)NSAddressOfSymbol (sym);
#elif defined(WIN32)
sp->value = (void *)GetProcAddress (handle, (MYCHAR *)sym);
#elif defined(HAVE_DL_DLOPEN)
/* dlsym() may fail for symbols not exported by object file;
* this can be safely ignored. */