aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac/GTMDefines.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/mac/GTMDefines.h')
-rw-r--r--src/common/mac/GTMDefines.h44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/common/mac/GTMDefines.h b/src/common/mac/GTMDefines.h
index b970d69c..14ffa7e1 100644
--- a/src/common/mac/GTMDefines.h
+++ b/src/common/mac/GTMDefines.h
@@ -193,9 +193,11 @@
// For iPhone specific stuff
#define GTM_IPHONE_SDK 1
#if TARGET_IPHONE_SIMULATOR
+ #define GTM_IPHONE_DEVICE 0
#define GTM_IPHONE_SIMULATOR 1
#else
#define GTM_IPHONE_DEVICE 1
+ #define GTM_IPHONE_SIMULATOR 0
#endif // TARGET_IPHONE_SIMULATOR
// By default, GTM has provided it's own unittesting support, define this
// to use the support provided by Xcode, especially for the Xcode4 support
@@ -203,9 +205,14 @@
#ifndef GTM_IPHONE_USE_SENTEST
#define GTM_IPHONE_USE_SENTEST 0
#endif
+ #define GTM_MACOS_SDK 0
#else
// For MacOS specific stuff
#define GTM_MACOS_SDK 1
+ #define GTM_IPHONE_SDK 0
+ #define GTM_IPHONE_SIMULATOR 0
+ #define GTM_IPHONE_DEVICE 0
+ #define GTM_IPHONE_USE_SENTEST 0
#endif
// Some of our own availability macros
@@ -217,21 +224,10 @@
#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE
#endif
-// Provide a symbol to include/exclude extra code for GC support. (This mainly
-// just controls the inclusion of finalize methods).
+// GC was dropped by Apple, define the old constant incase anyone still keys
+// off of it.
#ifndef GTM_SUPPORT_GC
- #if GTM_IPHONE_SDK
- // iPhone never needs GC
- #define GTM_SUPPORT_GC 0
- #else
- // We can't find a symbol to tell if GC is supported/required, so best we
- // do on Mac targets is include it if we're on 10.5 or later.
- #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
- #define GTM_SUPPORT_GC 0
- #else
- #define GTM_SUPPORT_GC 1
- #endif
- #endif
+ #define GTM_SUPPORT_GC 0
#endif
// To simplify support for 64bit (and Leopard in general), we provide the type
@@ -239,7 +235,7 @@
#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// NSInteger/NSUInteger and Max/Mins
#ifndef NSINTEGER_DEFINED
- #if __LP64__ || NS_BUILD_32_LIKE_64
+ #if (defined(__LP64__) && __LP64__) || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
@@ -352,7 +348,15 @@
#endif
#ifndef GTM_NONNULL
- #define GTM_NONNULL(x) __attribute__((nonnull(x)))
+ #if defined(__has_attribute)
+ #if __has_attribute(nonnull)
+ #define GTM_NONNULL(x) __attribute__((nonnull x))
+ #else
+ #define GTM_NONNULL(x)
+ #endif
+ #else
+ #define GTM_NONNULL(x)
+ #endif
#endif
// Invalidates the initializer from which it's called.
@@ -374,6 +378,14 @@
#endif
#endif
+#ifndef GTMCFAutorelease
+ #if __has_feature(objc_arc)
+ #define GTMCFAutorelease(x) CFBridgingRelease(x)
+ #else
+ #define GTMCFAutorelease(x) ([(id)x autorelease])
+ #endif
+#endif
+
#ifdef __OBJC__
// Declared here so that it can easily be used for logging tracking if