-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch-configure-xcode4bug.diff
33 lines (30 loc) · 1.19 KB
/
patch-configure-xcode4bug.diff
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
https://trac.macports.org/ticket/49272
https://bugs.python.org/issue24844
Compiling python fails in Xcode 4 (clang < 3.3) where existence of 'atomic'
is detected by configure, but it is not fully functional.
--- configure.orig 2022-12-07 05:31:21.000000000 +1100
+++ configure 2022-12-07 12:09:12.000000000 +1100
@@ -17359,6 +17359,24 @@
int main(void) {
__atomic_store_n(&val, 1, __ATOMIC_SEQ_CST);
(void)__atomic_load_n(&val, __ATOMIC_SEQ_CST);
+
+ /* https://bugs.python.org/issue24844 */
+ #define VERSION_CHECK(cc_major, cc_minor, req_major, req_minor) \
+ ((cc_major) > (req_major) || \
+ (cc_major) == (req_major) && (cc_minor) >= (req_minor))
+ #if defined(__clang__)
+ #if defined(__apple_build_version__)
+ // either one test or the other should work
+ // #if __apple_build_version__ < 5000000
+ #if !VERSION_CHECK(__clang_major__, __clang_minor__, 5, 0)
+ #error
+ #endif
+ // not sure if this is 3.3 or 3.4
+ #elif !VERSION_CHECK(__clang_major__, __clang_minor__, 3, 3)
+ #error
+ #endif
+ #endif
+
return 0;
}