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!
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VTTQ6MLAX5SK6XADHFEVEBHDFPXSUFO3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to