comparison Python/importdl.c @ 7114:fa09372f7872 legacy-trunk

Better #ifdefs for NetBSD, taking into account that at least on netBSD 1.3, dlopen() etc. are fully implemented, including dlerror(). From Jaromir Dolecek and Ty Sarna.
author Guido van Rossum <guido@python.org>
date Mon, 19 Jan 1998 22:03:52 +0000
parents 2e3acb2140bf
children c8745d205122
comparison
equal deleted inserted replaced
7113:f5f305d7a617 7114:fa09372f7872
51 _DL_FUNCPTR_DEFINED -- if the typedef dl_funcptr has been defined 51 _DL_FUNCPTR_DEFINED -- if the typedef dl_funcptr has been defined
52 USE_MAC_DYNAMIC_LOADING -- Mac CFM shared libraries 52 USE_MAC_DYNAMIC_LOADING -- Mac CFM shared libraries
53 SHORT_EXT -- short extension for dynamic module, e.g. ".so" 53 SHORT_EXT -- short extension for dynamic module, e.g. ".so"
54 LONG_EXT -- long extension, e.g. "module.so" 54 LONG_EXT -- long extension, e.g. "module.so"
55 hpux -- HP-UX Dynamic Linking - defined by the compiler 55 hpux -- HP-UX Dynamic Linking - defined by the compiler
56 __NetBSD__ -- NetBSD shared libraries (not quite SVR4 compatible) 56 __NetBSD__ -- NetBSD shared libraries
57 (assuming dlerror() was introduced between 1.2 and 1.3)
57 __FreeBSD__ -- FreeBSD shared libraries 58 __FreeBSD__ -- FreeBSD shared libraries
58 59
59 (The other WITH_* symbols are used only once, to set the 60 (The other WITH_* symbols are used only once, to set the
60 appropriate symbols.) 61 appropriate symbols.)
61 */ 62 */
86 #define _DL_FUNCPTR_DEFINED 1 87 #define _DL_FUNCPTR_DEFINED 1
87 #define SHORT_EXT ".pyd" 88 #define SHORT_EXT ".pyd"
88 #define LONG_EXT ".dll" 89 #define LONG_EXT ".dll"
89 #endif 90 #endif
90 91
91 #if defined(__NetBSD__) 92 #ifdef HAVE_SYS_PARAM_H
93 #include <sys/param.h>
94 #endif
95
96 #if defined(__NetBSD__) && (NetBSD < 199712)
92 #define DYNAMIC_LINK 97 #define DYNAMIC_LINK
93 #define USE_SHLIB 98 #define USE_SHLIB
94 99
95 #define dlerror() "error in dynamic linking" 100 #define dlerror() "error in dynamic linking"
96 #endif 101 #endif
155 #ifdef DYNAMIC_LINK 160 #ifdef DYNAMIC_LINK
156 161
157 #ifdef USE_SHLIB 162 #ifdef USE_SHLIB
158 #include <sys/types.h> 163 #include <sys/types.h>
159 #include <sys/stat.h> 164 #include <sys/stat.h>
160 #if defined(__NetBSD__) 165 #if defined(__NetBSD__) && (NetBSD < 199712)
161 #include <nlist.h> 166 #include <nlist.h>
162 #include <link.h> 167 #include <link.h>
163 #else 168 #else
164 #ifdef HAVE_DLFCN_H 169 #ifdef HAVE_DLFCN_H
165 #include <dlfcn.h> 170 #include <dlfcn.h>