Skip to content

Commit e1a9be2

Browse files
committed
Revert "[cxx-interop] Use up-to-date definition of CF_OPTIONS in tests"
This reverts commit f20617b.
1 parent e1d70f0 commit e1a9be2

File tree

1 file changed

+21
-39
lines changed

1 file changed

+21
-39
lines changed

test/Interop/Cxx/enum/Inputs/c-enums-withOptions-omit.h

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,39 @@
1-
typedef unsigned NSUInteger;
2-
3-
#define __CF_OPTIONS_ATTRIBUTES __attribute__((flag_enum,enum_extensibility(open)))
4-
#if (__cplusplus)
5-
#define CF_OPTIONS(_type, _name) __attribute__((availability(swift,unavailable))) _type _name; enum __CF_OPTIONS_ATTRIBUTES : _name
6-
#else
7-
#define CF_OPTIONS(_type, _name) enum __CF_OPTIONS_ATTRIBUTES _name : _type _name; enum _name : _type
8-
#endif
9-
10-
typedef CF_OPTIONS(NSUInteger, NSEnumerationOptions) {
11-
NSEnumerationConcurrent = (1UL << 0),
12-
NSEnumerationReverse = (1UL << 1),
13-
};
1+
// Enum usage that is bitwise-able and assignable in C++, aka how CF_OPTIONS
2+
// does things.
3+
typedef int __attribute__((availability(swift, unavailable))) NSEnumerationOptions;
4+
enum : NSEnumerationOptions { NSEnumerationConcurrent, NSEnumerationReverse };
145

156
@interface NSSet
167
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts ;
178
@end
189

19-
typedef CF_OPTIONS(NSUInteger, NSOrderedCollectionDifferenceCalculationOptions) {
10+
typedef int __attribute__((availability(swift, unavailable))) NSOrderedCollectionDifferenceCalculationOptions;
11+
enum : NSOrderedCollectionDifferenceCalculationOptions {
2012
NSOrderedCollectionDifferenceCalculationOptions1,
2113
NSOrderedCollectionDifferenceCalculationOptions2
2214
};
2315

24-
typedef CF_OPTIONS(NSUInteger, NSCalendarUnit) {
25-
NSCalendarUnit1,
26-
NSCalendarUnit2
27-
};
16+
typedef int __attribute__((availability(swift, unavailable))) NSCalendarUnit;
17+
enum : NSCalendarUnit { NSCalendarUnit1, NSCalendarUnit2 };
2818

29-
typedef CF_OPTIONS(NSUInteger, NSSearchPathDomainMask) {
30-
NSSearchPathDomainMask1,
31-
NSSearchPathDomainMask2
32-
};
19+
typedef int __attribute__((availability(swift, unavailable))) NSSearchPathDomainMask;
20+
enum : NSSearchPathDomainMask { NSSearchPathDomainMask1, NSSearchPathDomainMask2 };
3321

34-
typedef CF_OPTIONS(NSUInteger, NSControlCharacterAction) {
35-
NSControlCharacterAction1,
36-
NSControlCharacterAction2
37-
};
22+
typedef int __attribute__((availability(swift, unavailable))) NSControlCharacterAction;
23+
enum : NSControlCharacterAction { NSControlCharacterAction1, NSControlCharacterAction2 };
3824

39-
typedef CF_OPTIONS(NSUInteger, UIControlState) {
40-
UIControlState1,
41-
UIControlState2
42-
};
25+
typedef int __attribute__((availability(swift, unavailable))) UIControlState;
26+
enum : UIControlState { UIControlState1, UIControlState2 };
4327

44-
typedef CF_OPTIONS(NSUInteger, UITableViewCellStateMask) {
45-
UITableViewCellStateMask1,
46-
UITableViewCellStateMask2
47-
};
28+
typedef int __attribute__((availability(swift, unavailable))) UITableViewCellStateMask;
29+
enum : UITableViewCellStateMask { UITableViewCellStateMask1, UITableViewCellStateMask2 };
4830

49-
typedef CF_OPTIONS(NSUInteger, UIControlEvents) {
50-
UIControlEvents1,
51-
UIControlEvents2
52-
};
31+
typedef int __attribute__((availability(swift, unavailable))) UIControlEvents;
32+
enum : UIControlEvents { UIControlEvents1, UIControlEvents2 };
5333

54-
typedef CF_OPTIONS(NSUInteger, UITableViewScrollPosition) {
34+
typedef int __attribute__((availability(swift, unavailable)))
35+
UITableViewScrollPosition;
36+
enum : UITableViewScrollPosition {
5537
UITableViewScrollPosition1,
5638
UITableViewScrollPosition2
5739
};

0 commit comments

Comments
 (0)