summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-01-12 23:36:18 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-01-12 23:49:04 +0300
commitf98d476ffc0a8b76fdf9c7ae2d4ea758f14356ca (patch)
tree68445646c5c578bf2675e9b81cf2e2e09500df95
parent729d6b7965cf0b419c1fb65ac99bc740ddeee56b (diff)
downloadlibatomic_ops-f98d476ffc0a8b76fdf9c7ae2d4ea758f14356ca.tar.gz
Fix 'atomic_load/store symbols undefined' error on OS X 10.8 i386
Issue #23 (libatomic_ops). * src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET && !__x86_64__ && __APPLE__ && __MACH__]: Include AvailabilityMacros.h unless MAC_OS_X_VERSION_MIN_REQUIRED already defined. * src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET && !__x86_64__ && __APPLE__ && __MACH__ && MAC_OS_X_VERSION_MIN_REQUIRED < 1090] (AO_SKIPATOMIC_double_load, AO_SKIPATOMIC_double_load_acquire, AO_SKIPATOMIC_double_store, AO_SKIPATOMIC_double_store_release): Define.
-rw-r--r--src/atomic_ops/sysdeps/gcc/x86.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h
index 8d268b6..90b64bc 100644
--- a/src/atomic_ops/sysdeps/gcc/x86.h
+++ b/src/atomic_ops/sysdeps/gcc/x86.h
@@ -51,6 +51,21 @@
# define AO_GCC_FORCE_HAVE_CAS
# endif
+# if !defined(__x86_64__) && defined(__APPLE__) && defined(__MACH__)
+ /* OS X 10.8 lacks __atomic_load/store symbols for arch i386 (even */
+ /* with non-Apple clang). */
+# ifndef MAC_OS_X_VERSION_MIN_REQUIRED
+ /* Include this header just to import the version macro. */
+# include <AvailabilityMacros.h>
+# endif
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 /* MAC_OS_X_VERSION_10_9 */
+# define AO_SKIPATOMIC_double_load
+# define AO_SKIPATOMIC_double_load_acquire
+# define AO_SKIPATOMIC_double_store
+# define AO_SKIPATOMIC_double_store_release
+# endif
+# endif
+
#else /* AO_DISABLE_GCC_ATOMICS */
/* The following really assume we have a 486 or better. Unfortunately */