|
| 1 | +#include "CFAvailability.h" |
| 2 | + |
| 3 | +typedef unsigned long NSUInteger; |
| 4 | + |
1 | 5 | // Enum usage that is bitwise-able and assignable in C++, aka how CF_OPTIONS
|
2 | 6 | // does things.
|
3 |
| -typedef int __attribute__((availability(swift, unavailable))) NSEnumerationOptions; |
4 |
| -enum : NSEnumerationOptions { NSEnumerationConcurrent, NSEnumerationReverse }; |
| 7 | +typedef CF_OPTIONS(NSUInteger, NSEnumerationOptions) { |
| 8 | + NSEnumerationConcurrent = (1UL << 0), |
| 9 | + NSEnumerationReverse = (1UL << 1), |
| 10 | +}; |
5 | 11 |
|
6 | 12 | @interface NSSet
|
7 | 13 | - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts ;
|
8 | 14 | @end
|
9 | 15 |
|
10 |
| -typedef int __attribute__((availability(swift, unavailable))) NSOrderedCollectionDifferenceCalculationOptions; |
11 |
| -enum : NSOrderedCollectionDifferenceCalculationOptions { |
| 16 | +typedef CF_OPTIONS(NSUInteger, NSOrderedCollectionDifferenceCalculationOptions) { |
12 | 17 | NSOrderedCollectionDifferenceCalculationOptions1,
|
13 | 18 | NSOrderedCollectionDifferenceCalculationOptions2
|
14 | 19 | };
|
15 | 20 |
|
16 |
| -typedef int __attribute__((availability(swift, unavailable))) NSCalendarUnit; |
17 |
| -enum : NSCalendarUnit { NSCalendarUnit1, NSCalendarUnit2 }; |
| 21 | +typedef CF_OPTIONS(NSUInteger, NSCalendarUnit) { |
| 22 | + NSCalendarUnit1, |
| 23 | + NSCalendarUnit2 |
| 24 | +}; |
18 | 25 |
|
19 |
| -typedef int __attribute__((availability(swift, unavailable))) NSSearchPathDomainMask; |
20 |
| -enum : NSSearchPathDomainMask { NSSearchPathDomainMask1, NSSearchPathDomainMask2 }; |
| 26 | +typedef CF_OPTIONS(NSUInteger, NSSearchPathDomainMask) { |
| 27 | + NSSearchPathDomainMask1, |
| 28 | + NSSearchPathDomainMask2 |
| 29 | +}; |
21 | 30 |
|
22 |
| -typedef int __attribute__((availability(swift, unavailable))) NSControlCharacterAction; |
23 |
| -enum : NSControlCharacterAction { NSControlCharacterAction1, NSControlCharacterAction2 }; |
| 31 | +typedef CF_OPTIONS(NSUInteger, NSControlCharacterAction) { |
| 32 | + NSControlCharacterAction1, |
| 33 | + NSControlCharacterAction2 |
| 34 | +}; |
24 | 35 |
|
25 |
| -typedef int __attribute__((availability(swift, unavailable))) UIControlState; |
26 |
| -enum : UIControlState { UIControlState1, UIControlState2 }; |
| 36 | +typedef CF_OPTIONS(NSUInteger, UIControlState) { |
| 37 | + UIControlState1, |
| 38 | + UIControlState2 |
| 39 | +}; |
27 | 40 |
|
28 |
| -typedef int __attribute__((availability(swift, unavailable))) UITableViewCellStateMask; |
29 |
| -enum : UITableViewCellStateMask { UITableViewCellStateMask1, UITableViewCellStateMask2 }; |
| 41 | +typedef CF_OPTIONS(NSUInteger, UITableViewCellStateMask) { |
| 42 | + UITableViewCellStateMask1, |
| 43 | + UITableViewCellStateMask2 |
| 44 | +}; |
30 | 45 |
|
31 |
| -typedef int __attribute__((availability(swift, unavailable))) UIControlEvents; |
32 |
| -enum : UIControlEvents { UIControlEvents1, UIControlEvents2 }; |
| 46 | +typedef CF_OPTIONS(NSUInteger, UIControlEvents) { |
| 47 | + UIControlEvents1, |
| 48 | + UIControlEvents2 |
| 49 | +}; |
33 | 50 |
|
34 |
| -typedef int __attribute__((availability(swift, unavailable))) |
35 |
| -UITableViewScrollPosition; |
36 |
| -enum : UITableViewScrollPosition { |
| 51 | +typedef CF_OPTIONS(NSUInteger, UITableViewScrollPosition) { |
37 | 52 | UITableViewScrollPosition1,
|
38 | 53 | UITableViewScrollPosition2
|
39 | 54 | };
|
40 |
| - |
41 | 55 | @interface NSIndexPath
|
42 | 56 | @end
|
43 | 57 |
|
|
0 commit comments