aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMObjC2Runtime.h
diff options
context:
space:
mode:
Diffstat (limited to 'Foundation/GTMObjC2Runtime.h')
-rw-r--r--Foundation/GTMObjC2Runtime.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/Foundation/GTMObjC2Runtime.h b/Foundation/GTMObjC2Runtime.h
index 2c25841..4f569a5 100644
--- a/Foundation/GTMObjC2Runtime.h
+++ b/Foundation/GTMObjC2Runtime.h
@@ -75,7 +75,7 @@ OBJC_EXPORT struct objc_method_description protocol_getMethodDescription(Protoco
// barrier versions.
GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate,
void *replacement,
- volatile void *theValue) {
+ void * volatile *theValue) {
#if defined(__LP64__) && __LP64__
return OSAtomicCompareAndSwap64Barrier((int64_t)predicate,
(int64_t)replacement,
@@ -86,21 +86,24 @@ GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate,
(int32_t *)theValue);
#endif // defined(__LP64__) && __LP64__
}
-
+
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) || (GTM_IPHONE_DEVICE)
+
GTM_INLINE BOOL objc_atomicCompareAndSwapGlobalBarrier(id predicate,
id replacement,
volatile id *objectLocation) {
return OSAtomicCompareAndSwapPtrBarrier(predicate,
replacement,
- objectLocation);
+ (void * volatile *)objectLocation);
}
GTM_INLINE BOOL objc_atomicCompareAndSwapInstanceVariableBarrier(id predicate,
id replacement,
volatile id *objectLocation) {
return OSAtomicCompareAndSwapPtrBarrier(predicate,
replacement,
- objectLocation);
+ (void * volatile *)objectLocation);
}
-#endif
-
-#endif // OBJC2_UNAVAILABLE
+#endif // (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) || (GTM_IPHONE_DEVICE)