forked from astral-sh/python-build-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch-ctypes-callproc-legacy.patch
34 lines (33 loc) · 1.28 KB
/
patch-ctypes-callproc-legacy.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index b0f1e0bd04..80e81fe65c 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -1450,29 +1450,8 @@ copy_com_pointer(PyObject *self, PyObject *args)
}
#else
#ifdef __APPLE__
-#ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
__builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
-#else
-// Support the deprecated case of compiling on an older macOS version
-static void *libsystem_b_handle;
-static bool (*_dyld_shared_cache_contains_path)(const char *path);
-
-__attribute__((constructor)) void load_dyld_shared_cache_contains_path(void) {
- libsystem_b_handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY);
- if (libsystem_b_handle != NULL) {
- _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
- }
-}
-
-__attribute__((destructor)) void unload_dyld_shared_cache_contains_path(void) {
- if (libsystem_b_handle != NULL) {
- dlclose(libsystem_b_handle);
- }
-}
-#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
- _dyld_shared_cache_contains_path != NULL
-#endif
static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *args)
{