non-standard dlerror declaration in _ctypes/darwin/dlfcn.h?
The extern declaration for dlerror() in _ctypes/darwin/dlfcn.h does not match the declaration in the macOS 10.4/10.5 SDK, causing a compile error for dlfcn_simple.c for statically linking the interpreter and modules (for example with pyqtdeploy). The line in question is in the following snippet. Changing "extern const char *dlerror" to "extern char *dlerror" fixes the problem. What is the rationale for the current "const char *" declaration when the macOS SDK and GNU spec uses "char *"? #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_2 #warning CTYPES_DARWIN_DLFCN #define CTYPES_DARWIN_DLFCN extern void * (*ctypes_dlopen)(const char *path, int mode); extern void * (*ctypes_dlsym)(void * handle, const char *symbol); extern const char * (*ctypes_dlerror)(void); extern int (*ctypes_dlclose)(void * handle); extern int (*ctypes_dladdr)(const void *, Dl_info *); #else extern void * dlopen(const char *path, int mode); extern void * dlsym(void * handle, const char *symbol); extern const char * dlerror(void); extern int dlclose(void * handle); extern int dladdr(const void *, Dl_info *); #endif Cheers!
participants (1)
-
patrickkidd@gmail.com