diff --git a/configure.ac b/configure.ac index 3224fee..372658b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/loadlib.c b/src/loadlib.c index e6e0c3c..fed863b 100644 --- a/src/loadlib.c +++ b/src/loadlib.c @@ -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. */