1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* dynl.c: Use ANSI prototypes.

(sysdep_dynl_link): Use lt_dlopenext instead of lt_dlopen.
* dynl.c: use libltdl if DYNAMIC_LINKING is enabled,
This commit is contained in:
Marius Vollmer 2000-01-10 00:36:26 +00:00
parent 6165ede38b
commit 4feb69af5a

View file

@ -230,14 +230,52 @@ only by module bookkeeping operations.")
#define DYNL_GLOBAL 0x0001
#ifdef HAVE_DLOPEN
#include "dynl-dl.c"
#else
#ifdef HAVE_SHL_LOAD
#include "dynl-shl.c"
#else
#ifdef HAVE_LIBDLD
#include "dynl-dld.c"
#ifdef DYNAMIC_LINKING
#include <ltdl.h>
static void *
sysdep_dynl_link (const char *fname, int flags, const char *subr)
{
lt_dlhandle handle = lt_dlopenext (fname);
if (NULL == handle)
{
SCM_ALLOW_INTS;
scm_misc_error (subr, (char *)lt_dlerror (), SCM_EOL);
}
return (void *) handle;
}
static void
sysdep_dynl_unlink (void *handle, const char *subr)
{
if (lt_dlclose ((lt_dlhandle) handle))
{
SCM_ALLOW_INTS;
scm_misc_error (subr, (char *)lt_dlerror (), SCM_EOL);
}
}
static void *
sysdep_dynl_func (const char *symb, void *handle, const char *subr)
{
void *fptr;
fptr = lt_dlsym ((lt_dlhandle) handle, symb);
if (!fptr)
{
SCM_ALLOW_INTS;
scm_misc_error (subr, (char *)lt_dlerror (), SCM_EOL);
}
return fptr;
}
static void
sysdep_dynl_init ()
{
lt_dlinit ();
}
#else
/* no dynamic linking available, throw errors. */
@ -279,8 +317,6 @@ sysdep_dynl_func (const char *symbol,
return NULL;
}
#endif
#endif
#endif
int scm_tc16_dynamic_obj;