Files

34 lines
1.2 KiB
Diff
Raw Permalink Normal View History

2019-11-20 21:47:20 +11:00
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 2019-11-08 19:37:57.000000000 +1100
+++ configure 2019-11-08 19:52:06.000000000 +1100
@@ -16802,6 +16802,24 @@
volatile int val = 1;
int main() {
__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;
}