1
- #define generateVersionDeclarations (V1, V2 ) \
2
- __attribute__ ((availability(ios, introduced = V1))) \
3
- @interface TNSInterface \
4
- ##V2##Plus : NSObject \
5
- @end \
6
- \
7
- @interface TNSInterfaceMembers \
8
- ##V2 : NSObject \
9
- @property int property \
10
- __attribute__ ((availability(ios, introduced = V1))); \
11
- \
12
- +(void )staticMethod \
13
- __attribute__ ((availability(ios, introduced = V1))); \
14
- \
15
- -(void )instanceMethod \
16
- __attribute__ ((availability(ios, introduced = V1))); \
17
- @end \
18
- \
19
- __attribute__ ((availability(ios, introduced = V1))) void TNSFunction##V2##Plus(); \
20
- \
21
- __attribute__ ((availability(ios, introduced = V1))) extern const int TNSConstant##V2##Plus; \
22
- \
23
- enum TNSEnum##V2##Plus { \
24
- TNSEnum##V2##Member \
25
- } \
26
- __attribute__ ((availability(ios, introduced = V1)))
1
+ #define generateVersionDeclarations (V1, V2 ) \
2
+ __attribute__ ((availability(ios, introduced = V1))) \
3
+ __attribute__((availability(visionos, introduced = V1))) @interface TNSInterface \
4
+ ##V2##Plus : NSObject @end \
5
+ \
6
+ @interface TNSInterfaceMembers \
7
+ ##V2 : NSObject @property int property __attribute__ ((availability(ios, introduced = V1))) \
8
+ __attribute__((availability(visionos, introduced = V1))); \
9
+ \
10
+ +(void )staticMethod __attribute__ ((availability(ios, introduced = V1))) \
11
+ __attribute__((availability(visionos, introduced = V1))); \
12
+ \
13
+ -(void )instanceMethod __attribute__ ((availability(ios, introduced = V1))) \
14
+ __attribute__((availability(visionos, introduced = V1))); \
15
+ @end \
16
+ \
17
+ __attribute__ ((availability(ios, introduced = V1))) \
18
+ __attribute__((availability(visionos, introduced = V1))) void TNSFunction##V2##Plus(); \
19
+ \
20
+ __attribute__ ((availability(ios, introduced = V1))) __attribute__( \
21
+ (availability(visionos, introduced = V1))) extern const int TNSConstant##V2##Plus; \
22
+ \
23
+ enum TNSEnum##V2##Plus { TNSEnum##V2##Member } \
24
+ __attribute__ ((availability(ios, introduced = V1))) \
25
+ __attribute__((availability(visionos, introduced = V1)))
27
26
28
27
#ifndef generateVersionImpl
29
- #define generateVersion (V1, V2 ) \
30
- generateVersionDeclarations (V1, V2)
28
+ #define generateVersion (V1, V2 ) generateVersionDeclarations(V1, V2)
31
29
#else
32
- #define generateVersion (V1, V2 ) \
33
- generateVersionDeclarations (V1, V2); \
34
- \
35
- @implementation TNSInterface \
36
- ##V2##Plus \
37
- @end \
38
- \
39
- @implementation TNSInterfaceMembers \
40
- ##V2 \
41
- + (void )staticMethod{} \
42
- \
43
- - (void )instanceMethod {} \
44
- @end \
45
- \
46
- void TNSFunction##V2##Plus() {} \
47
- \
48
- const int TNSConstant##V2##Plus = 0
30
+ #define generateVersion (V1, V2 ) \
31
+ generateVersionDeclarations (V1, V2); \
32
+ \
33
+ @implementation TNSInterface \
34
+ ##V2##Plus @end \
35
+ \
36
+ @implementation TNSInterfaceMembers \
37
+ ##V2 + (void )staticMethod{} \
38
+ \
39
+ - (void )instanceMethod {} \
40
+ @end \
41
+ \
42
+ void TNSFunction##V2##Plus() {} \
43
+ \
44
+ const int TNSConstant##V2##Plus = 0
49
45
#endif
50
46
51
- #define generateMinors (MAJOR ) \
52
- generateVersion (MAJOR##.0 , MAJOR##_0); \
53
- generateVersion (MAJOR##.1 , MAJOR##_1); \
54
- generateVersion (MAJOR##.2 , MAJOR##_2); \
55
- generateVersion (MAJOR##.3 , MAJOR##_3); \
56
- generateVersion (MAJOR##.4 , MAJOR##_4); \
57
- generateVersion (MAJOR##.5 , MAJOR##_5);
47
+ #define generateMinors (MAJOR ) \
48
+ generateVersion (MAJOR##.0 , MAJOR##_0); \
49
+ generateVersion (MAJOR##.1 , MAJOR##_1); \
50
+ generateVersion (MAJOR##.2 , MAJOR##_2); \
51
+ generateVersion (MAJOR##.3 , MAJOR##_3); \
52
+ generateVersion (MAJOR##.4 , MAJOR##_4); \
53
+ generateVersion (MAJOR##.5 , MAJOR##_5);
58
54
55
+ generateMinors (1 );
56
+ generateMinors (2 );
59
57
generateMinors (9 );
60
58
generateMinors (10 );
61
59
generateMinors (11 );
@@ -64,10 +62,12 @@ generateMinors(13);
64
62
generateMinors (14 );
65
63
generateMinors (15 );
66
64
67
- // max availability version that can be currently represented in the binary metadata is 31.7 (major << 3 | minor) -> uint8_t
65
+ // max availability version that can be currently represented in the binary metadata is 31.7 (major
66
+ // << 3 | minor) -> uint8_t
68
67
#define MAX_AVAILABILITY 31.7
69
68
70
69
__attribute__ ((availability(ios, introduced = MAX_AVAILABILITY)))
70
+ __attribute__((availability(visionos, introduced = MAX_AVAILABILITY)))
71
71
@protocol TNSProtocolNeverAvailable<NSObject>
72
72
73
73
@property(class, readonly) int staticPropertyFromProtocolNeverAvailable;
@@ -85,6 +85,7 @@ __attribute__((availability(ios, introduced = MAX_AVAILABILITY)))
85
85
@end
86
86
87
87
__attribute__ ((availability(ios, introduced = 1.0 )))
88
+ __attribute__((availability(visionos, introduced = 1.0 )))
88
89
@protocol TNSProtocolAlwaysAvailable<NSObject>
89
90
90
91
@property(class, readonly) int staticPropertyFromProtocolAlwaysAvailable;
@@ -97,10 +98,12 @@ __attribute__((availability(ios, introduced = 1.0)))
97
98
98
99
@end
99
100
100
- @interface TNSInterfaceAlwaysAvailable : NSObject <TNSProtocolNeverAvailable, TNSProtocolAlwaysAvailable>
101
+ @interface TNSInterfaceAlwaysAvailable
102
+ : NSObject <TNSProtocolNeverAvailable, TNSProtocolAlwaysAvailable>
101
103
@end
102
104
103
105
__attribute__ ((availability(ios, introduced = MAX_AVAILABILITY)))
106
+ __attribute__((availability(visionos, introduced = MAX_AVAILABILITY)))
104
107
@interface TNSInterfaceNeverAvailable : TNSInterfaceAlwaysAvailable
105
108
@end
106
109
0 commit comments