123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- #include <AvailabilityMacros.h>
- #include <TargetConditionals.h>
- #if TARGET_OS_IPHONE
- #include <Availability.h>
- #endif
- #ifndef MAC_OS_X_VERSION_10_5
- #define MAC_OS_X_VERSION_10_5 1050
- #endif
- #ifndef MAC_OS_X_VERSION_10_6
- #define MAC_OS_X_VERSION_10_6 1060
- #endif
- #ifndef __IPHONE_2_1
- #define __IPHONE_2_1 20100
- #endif
- #ifndef __IPHONE_2_2
- #define __IPHONE_2_2 20200
- #endif
- #ifndef __IPHONE_3_0
- #define __IPHONE_3_0 30000
- #endif
- #ifndef __IPHONE_3_1
- #define __IPHONE_3_1 30100
- #endif
- #ifndef __IPHONE_3_2
- #define __IPHONE_3_2 30200
- #endif
- #ifndef __IPHONE_4_0
- #define __IPHONE_4_0 40000
- #endif
- #ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT
- #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0
- #endif
- #if !defined(GTM_INLINE)
- #if defined (__GNUC__) && (__GNUC__ == 4)
- #define GTM_INLINE static __inline__ __attribute__((always_inline))
- #else
- #define GTM_INLINE static __inline__
- #endif
- #endif
- #if !defined (GTM_EXTERN)
- #if defined __cplusplus
- #define GTM_EXTERN extern "C"
- #else
- #define GTM_EXTERN extern
- #endif
- #endif
- #if !defined (GTM_EXPORT)
- #define GTM_EXPORT __attribute__((visibility("default")))
- #endif
- #ifndef _GTMDevLog
- #ifdef DEBUG
- #define _GTMDevLog(...) NSLog(__VA_ARGS__)
- #else
- #define _GTMDevLog(...) do { } while (0)
- #endif
- #endif
- @class NSString
- GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...)
- #ifndef _GTMDevAssert
- #if !defined(NS_BLOCK_ASSERTIONS)
- #define _GTMDevAssert(condition, ...) \
- do { \
- if (!(condition)) { \
- [[NSAssertionHandler currentHandler] \
- handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
- file:[NSString stringWithUTF8String:__FILE__] \
- lineNumber:__LINE__ \
- description:__VA_ARGS__]
- } \
- } while(0)
- #else
- #define _GTMDevAssert(condition, ...) do { } while (0)
- #endif
- #endif
- #ifndef _GTMCompileAssert
- #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg
- #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg)
- #define _GTMCompileAssert(test, msg) \
- typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
- #endif
- #if !defined (GTM_NSSTRINGIFY)
- #define GTM_NSSTRINGIFY_INNER(x) @#x
- #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x)
- #endif
- #ifndef GTM_FOREACH_OBJECT
- #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
- #define GTM_FOREACH_ENUMEREE(element, enumeration) \
- for (element in enumeration)
- #define GTM_FOREACH_OBJECT(element, collection) \
- for (element in collection)
- #define GTM_FOREACH_KEY(element, collection) \
- for (element in collection)
- #else
- #define GTM_FOREACH_ENUMEREE(element, enumeration) \
- for (NSEnumerator *_ ## element ## _enum = enumeration; \
- (element = [_ ## element ## _enum nextObject]) != nil; )
- #define GTM_FOREACH_OBJECT(element, collection) \
- GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator])
- #define GTM_FOREACH_KEY(element, collection) \
- GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator])
- #endif
- #endif
- #if TARGET_OS_IPHONE
- #define GTM_IPHONE_SDK 1
- #if TARGET_IPHONE_SIMULATOR
- #define GTM_IPHONE_SIMULATOR 1
- #else
- #define GTM_IPHONE_DEVICE 1
- #endif
- #else
- #define GTM_MACOS_SDK 1
- #endif
- #if GTM_MACOS_SDK
- #define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE
- #define GTM_AVAILABLE_ONLY_ON_MACOS
- #else
- #define GTM_AVAILABLE_ONLY_ON_IPHONE
- #define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE
- #endif
- #ifndef GTM_SUPPORT_GC
- #if GTM_IPHONE_SDK
- #define GTM_SUPPORT_GC 0
- #else
- #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
- #endif
- #if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
- #ifndef NSINTEGER_DEFINED
- #if __LP64__ || NS_BUILD_32_LIKE_64
- typedef long NSInteger
- typedef unsigned long NSUInteger
- #else
- typedef int NSInteger
- typedef unsigned int NSUInteger
- #endif
- #define NSIntegerMax LONG_MAX
- #define NSIntegerMin LONG_MIN
- #define NSUIntegerMax ULONG_MAX
- #define NSINTEGER_DEFINED 1
- #endif
- #ifndef CGFLOAT_DEFINED
- #if defined(__LP64__) && __LP64__
- typedef double CGFloat
- #define CGFLOAT_MIN DBL_MIN
- #define CGFLOAT_MAX DBL_MAX
- #define CGFLOAT_IS_DOUBLE 1
- #else
- typedef float CGFloat
- #define CGFLOAT_MIN FLT_MIN
- #define CGFLOAT_MAX FLT_MAX
- #define CGFLOAT_IS_DOUBLE 0
- #endif
- #define CGFLOAT_DEFINED 1
- #endif
- #endif
- #ifndef __has_feature
- #define __has_feature(x) 0
- #endif
- #ifndef NS_RETURNS_RETAINED
- #if __has_feature(attribute_ns_returns_retained)
- #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
- #else
- #define NS_RETURNS_RETAINED
- #endif
- #endif
- #ifndef NS_RETURNS_NOT_RETAINED
- #if __has_feature(attribute_ns_returns_not_retained)
- #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
- #else
- #define NS_RETURNS_NOT_RETAINED
- #endif
- #endif
- #ifndef CF_RETURNS_RETAINED
- #if __has_feature(attribute_cf_returns_retained)
- #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
- #else
- #define CF_RETURNS_RETAINED
- #endif
- #endif
- #ifndef CF_RETURNS_NOT_RETAINED
- #if __has_feature(attribute_cf_returns_not_retained)
- #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
- #else
- #define CF_RETURNS_NOT_RETAINED
- #endif
- #endif
- #ifndef NS_FORMAT_ARGUMENT
- #define NS_FORMAT_ARGUMENT(A)
- #endif
- #ifndef NS_FORMAT_FUNCTION
- #define NS_FORMAT_FUNCTION(F,A)
- #endif
- #ifndef GTM_NONNULL
- #define GTM_NONNULL(x) __attribute__((nonnull(x)))
- #endif
- #if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
- #define GTM_10_6_PROTOCOLS_DEFINED 1
- @protocol NSConnectionDelegate
- @end
- @protocol NSAnimationDelegate
- @end
- @protocol NSImageDelegate
- @end
- @protocol NSTabViewDelegate
- @end
- #endif
|