X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsysdll.c;h=d6e7df9018a83dc9bd510384688ee668fdc77245;hb=02276b8e7e7b7e647493d52f77beb00d64951836;hp=d5f309c3638e84a142a7abe999796e193841df80;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git- diff --git a/src/sysdll.c b/src/sysdll.c index d5f309c..d6e7df9 100644 --- a/src/sysdll.c +++ b/src/sysdll.c @@ -23,24 +23,20 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include #endif -#include -#include -#include -#include #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 @@ -84,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