X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsysdll.c;h=d6e7df9018a83dc9bd510384688ee668fdc77245;hb=f8c889244f022ae695ea8dc67267499286921903;hp=f3398739563e17ca3b5b8d501d979e4adc9e3330;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git- diff --git a/src/sysdll.c b/src/sysdll.c index f339873..d6e7df9 100644 --- a/src/sysdll.c +++ b/src/sysdll.c @@ -25,18 +25,18 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "sysdll.h" -/* This whole file is conditional upon HAVE_DLL */ +/* This whole file is conditional upon HAVE_SHLIB */ #ifdef HAVE_SHLIB /* Thankfully, most systems follow the ELFish dlopen() method. ** HAVE__DLOPEN is lame, but SCO has their dl* functions as _dl*, and ** unless you include dlfcn.h you don't get the macros to mask them, and -** autoconf fails to find them. +** autoconf fails to find them. No longer true as of 5.0.5. ** ** Anybody who wants to use this on SCO needs to have their configure.in ** look for _dlopen() as well as dlopen() */ -#if defined(HAVE_DLOPEN) || defined(HAVE__DLOPEN) +#if defined(HAVE_DLOPEN) || defined(HAVE__DLOPEN) || defined(HAVE_DLFCN_H) #include #ifndef RTLD_LAZY @@ -80,14 +80,22 @@ dll_function (dll_handle h, CONST char *n) dll_var dll_variable (dll_handle h, CONST char *n) { +#ifdef DLSYM_NEEDS_UNDERSCORE + char *buf = alloca_array (char, strlen (n) + 2); + *buf = '_'; + (void)strcpy(buf + 1, n); + n = buf; +#endif return (dll_var)dlsym ((void *)h, n); } CONST char * dll_error (dll_handle h) { -#ifdef HAVE_DLERROR +#if defined(HAVE_DLERROR) || defined(dlerror) return (CONST char *)dlerror (); +#elif defined(HAVE__DLERROR) + return (const char *)_dlerror(); #else return "Shared library error"; #endif