From 9291df448a0958c579c300477944308c488d4434 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 13 Apr 2010 13:03:48 +0000 Subject: [Author: thomasvl] Change the guards for the atomic ops, this seems to make all the iPhone SDKS that come with 3.1.3 happy. Will test 3.2 after landing this. TBR=dmaclach --- Foundation/GTMObjC2Runtime.h | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'Foundation/GTMObjC2Runtime.h') diff --git a/Foundation/GTMObjC2Runtime.h b/Foundation/GTMObjC2Runtime.h index c469ec5..fd663c8 100644 --- a/Foundation/GTMObjC2Runtime.h +++ b/Foundation/GTMObjC2Runtime.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -20,10 +20,10 @@ #import #import "GTMDefines.h" -// These functions exist for code that we want to compile on both the < 10.5 -// sdks and on the >= 10.5 sdks without warnings. It basically reimplements -// certain parts of the objc2 runtime in terms of the objc1 runtime. It is not -// a complete implementation as I've only implemented the routines I know we +// These functions exist for code that we want to compile on both the < 10.5 +// sdks and on the >= 10.5 sdks without warnings. It basically reimplements +// certain parts of the objc2 runtime in terms of the objc1 runtime. It is not +// a complete implementation as I've only implemented the routines I know we // use. Feel free to add more as necessary. // These functions are not documented because they conform to the documentation // for the ObjC2 Runtime. @@ -36,7 +36,7 @@ #define AT_REQUIRED #endif -// The file objc-runtime.h was moved to runtime.h and in Leopard, objc-runtime.h +// The file objc-runtime.h was moved to runtime.h and in Leopard, objc-runtime.h // was just a wrapper around runtime.h. For the iPhone SDK, this objc-runtime.h // is removed in the iPhoneOS2.0 SDK. // @@ -92,23 +92,20 @@ GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate, #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) \ - || (defined(__IPHONE_3_0) \ - && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0)) +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 -GTM_INLINE BOOL objc_atomicCompareAndSwapGlobalBarrier(id predicate, - id replacement, +GTM_INLINE BOOL objc_atomicCompareAndSwapGlobalBarrier(id predicate, + id replacement, volatile id *objectLocation) { - return OSAtomicCompareAndSwapPtrBarrier(predicate, - replacement, + return OSAtomicCompareAndSwapPtrBarrier(predicate, + replacement, (void * volatile *)objectLocation); } -GTM_INLINE BOOL objc_atomicCompareAndSwapInstanceVariableBarrier(id predicate, - id replacement, +GTM_INLINE BOOL objc_atomicCompareAndSwapInstanceVariableBarrier(id predicate, + id replacement, volatile id *objectLocation) { - return OSAtomicCompareAndSwapPtrBarrier(predicate, - replacement, + return OSAtomicCompareAndSwapPtrBarrier(predicate, + replacement, (void * volatile *)objectLocation); } -#endif // (OS_MIN > 10.5) || (GTM_IPHONE_DEVICE) || (IPHONE_MIN > 3.0) +#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 -- cgit v1.2.3