if test "${HAVE_MODULES}" = no; then
AC_MSG_ERROR([Dynamic modules are not supported on your system])
+ else
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $LIBMODULES"
+ AC_CHECK_FUNCS([dlfunc])
+ LIBS=$SAVE_LIBS
fi
fi
#error "No dynamic loading for this system"
#endif
+
+#if !HAVE_DLFUNC
+# define dlfunc dynlib_sym
+#endif
+
+dynlib_function_ptr
+dynlib_func (dynlib_handle_ptr h, const char *sym)
+{
+ return (dynlib_function_ptr) dlfunc (h, sym);
+}
typedef void *dynlib_handle_ptr;
dynlib_handle_ptr dynlib_open (const char *path);
void *dynlib_sym (dynlib_handle_ptr h, const char *sym);
+typedef struct dynlib_function_ptr_nonce *(*dynlib_function_ptr) (void);
+dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym);
bool dynlib_addr (void *ptr, const char **path, const char **sym);
const char *dynlib_error (void);
int dynlib_close (dynlib_handle_ptr h);
if (!gpl_sym)
error ("Module %s is not GPL compatible", SDATA (file));
- module_init = (emacs_init_function) dynlib_sym (handle, "emacs_module_init");
+ module_init = (emacs_init_function) dynlib_func (handle, "emacs_module_init");
if (!module_init)
error ("Module %s does not have an init function.", SDATA (file));
/* Mark all objects allocated from local environments so that they
don't get garbage-collected. */
-void mark_modules (void)
+void
+mark_modules (void)
{
for (Lisp_Object tem = Vmodule_environments; CONSP (tem); tem = XCDR (tem))
{