Mercurial > hg > xemacs-beta
diff src/sysdll.c @ 388:aabb7f5b1c81 r21-2-9
Import from CVS: tag r21-2-9
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:09:42 +0200 |
parents | 8626e4521993 |
children | 74fd4e045ea6 |
line wrap: on
line diff
--- a/src/sysdll.c Mon Aug 13 11:08:51 2007 +0200 +++ b/src/sysdll.c Mon Aug 13 11:09:42 2007 +0200 @@ -25,18 +25,18 @@ #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 <dlfcn.h> #ifndef RTLD_LAZY @@ -80,14 +80,22 @@ 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