mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When importing a specialized type for an Objective-C collection (e.g., NSArray<NSString *> *) that is being bridged to a Swift collection, produce a more specialized Swift collection type (e.g., [String]) that we would for the unspecialized type ([NSObject]). The CMake and lit hackery is here because we need to be able to build against versions of Clang that both do and do not have Objective-C generics. Swift SVN r24196
32 lines
844 B
C
32 lines
844 B
C
#ifndef OBJC_OBJC_H_
|
|
#define OBJC_OBJC_H_
|
|
|
|
#define OBJC_ARC_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
|
|
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE OBJC_ARC_UNAVAILABLE
|
|
|
|
typedef unsigned long NSUInteger;
|
|
typedef long NSInteger;
|
|
typedef __typeof__(__objc_yes) BOOL;
|
|
|
|
typedef struct objc_selector *SEL;
|
|
SEL sel_registerName(const char *str);
|
|
|
|
void NSDeallocateObject(id object) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
|
|
|
|
#undef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
|
|
|
|
#define OBJC_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
|
|
#define OBJC_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
|
|
|
|
typedef OBJC_ENUM(int, objc_abi) {
|
|
objc_v1 = 0,
|
|
objc_v2 = 2
|
|
};
|
|
|
|
typedef OBJC_OPTIONS(int, objc_flags) {
|
|
objc_taggedPointer = 1 << 0,
|
|
objc_swiftRefcount = 1 << 1
|
|
};
|
|
|
|
#endif
|