-
-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy pathpatch-ctypes-callproc.patch
40 lines (39 loc) · 1.52 KB
/
patch-ctypes-callproc.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
35
36
37
38
39
40
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index f42ff08f58..e0a698b6b2 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -1446,34 +1446,8 @@ copy_com_pointer(PyObject *self, PyObject *args)
}
#else
#ifdef __APPLE__
-#ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
-# ifdef HAVE_BUILTIN_AVAILABLE
-# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
- __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
-# else
-# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
- (_dyld_shared_cache_contains_path != NULL)
-# endif
-#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
+ __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *args)
{