@@ -26,6 +26,7 @@ public typealias dispatch_block_t = @convention(block) () -> Void
26
26
// FIXME: rdar://16851050 update API so these import better
27
27
//===----------------------------------------------------------------------===//
28
28
29
+ #if _runtime(_ObjC)
29
30
// dispatch/io.h
30
31
public var DISPATCH_IO_STREAM : dispatch_io_type_t {
31
32
return 0
@@ -40,6 +41,9 @@ public var DISPATCH_IO_STOP: dispatch_io_close_flags_t {
40
41
public var DISPATCH_IO_STRICT_INTERVAL : dispatch_io_interval_flags_t {
41
42
return 1
42
43
}
44
+ #endif // _runtime(_ObjC)
45
+
46
+ public typealias dispatch_queue_priority_t = Int
43
47
44
48
// dispatch/queue.h
45
49
public var DISPATCH_QUEUE_SERIAL : dispatch_queue_attr_t ! {
@@ -64,6 +68,7 @@ public var DISPATCH_QUEUE_PRIORITY_BACKGROUND: dispatch_queue_priority_t {
64
68
return - 32768
65
69
}
66
70
71
+ #if _runtime(_ObjC)
67
72
@warn_unused_result
68
73
public func dispatch_get_global_queue( identifier: qos_class_t ,
69
74
_ flags: UInt ) -> dispatch_queue_t {
@@ -107,6 +112,8 @@ public var DISPATCH_PROC_EXIT: dispatch_source_proc_flags_t {
107
112
public var DISPATCH_PROC_FORK : dispatch_source_proc_flags_t { return 0x40000000 }
108
113
public var DISPATCH_PROC_EXEC : dispatch_source_proc_flags_t { return 0x20000000 }
109
114
public var DISPATCH_PROC_SIGNAL : dispatch_source_proc_flags_t { return 0x08000000 }
115
+
116
+
110
117
public var DISPATCH_VNODE_DELETE : dispatch_source_vnode_flags_t { return 0x1 }
111
118
public var DISPATCH_VNODE_WRITE : dispatch_source_vnode_flags_t { return 0x2 }
112
119
public var DISPATCH_VNODE_EXTEND : dispatch_source_vnode_flags_t { return 0x4 }
@@ -115,37 +122,23 @@ public var DISPATCH_VNODE_LINK: dispatch_source_vnode_flags_t { return 0x10 }
115
122
public var DISPATCH_VNODE_RENAME : dispatch_source_vnode_flags_t { return 0x20 }
116
123
public var DISPATCH_VNODE_REVOKE : dispatch_source_vnode_flags_t { return 0x40 }
117
124
public var DISPATCH_TIMER_STRICT : dispatch_source_timer_flags_t { return 1 }
125
+ #endif // _runtime(_ObjC)
118
126
119
127
public var DISPATCH_SOURCE_TYPE_DATA_ADD : dispatch_source_type_t {
120
128
return _swift_dispatch_source_type_data_add ( )
121
129
}
122
130
public var DISPATCH_SOURCE_TYPE_DATA_OR : dispatch_source_type_t {
123
131
return _swift_dispatch_source_type_data_or ( )
124
132
}
125
- public var DISPATCH_SOURCE_TYPE_MACH_SEND : dispatch_source_type_t {
126
- return _swift_dispatch_source_type_mach_send ( )
127
- }
128
- public var DISPATCH_SOURCE_TYPE_MACH_RECV : dispatch_source_type_t {
129
- return _swift_dispatch_source_type_mach_recv ( )
130
- }
131
- public var DISPATCH_SOURCE_TYPE_MEMORYPRESSURE : dispatch_source_type_t {
132
- return _swift_dispatch_source_type_memorypressure ( )
133
- }
134
133
public var DISPATCH_SOURCE_TYPE_READ : dispatch_source_type_t {
135
134
return _swift_dispatch_source_type_read ( )
136
135
}
137
- public var DISPATCH_SOURCE_TYPE_PROC : dispatch_source_type_t {
138
- return _swift_dispatch_source_type_proc ( )
139
- }
140
136
public var DISPATCH_SOURCE_TYPE_SIGNAL : dispatch_source_type_t {
141
137
return _swift_dispatch_source_type_signal ( )
142
138
}
143
139
public var DISPATCH_SOURCE_TYPE_TIMER : dispatch_source_type_t {
144
140
return _swift_dispatch_source_type_timer ( )
145
141
}
146
- public var DISPATCH_SOURCE_TYPE_VNODE : dispatch_source_type_t {
147
- return _swift_dispatch_source_type_vnode ( )
148
- }
149
142
public var DISPATCH_SOURCE_TYPE_WRITE : dispatch_source_type_t {
150
143
return _swift_dispatch_source_type_write ( )
151
144
}
@@ -158,6 +151,39 @@ internal func _swift_dispatch_source_type_data_add() -> dispatch_source_type_t
158
151
@asmname ( " _swift_dispatch_source_type_DATA_OR " )
159
152
internal func _swift_dispatch_source_type_data_or( ) -> dispatch_source_type_t
160
153
154
+ @warn_unused_result
155
+ @asmname ( " _swift_dispatch_source_type_READ " )
156
+ internal func _swift_dispatch_source_type_read( ) -> dispatch_source_type_t
157
+
158
+ @warn_unused_result
159
+ @asmname ( " _swift_dispatch_source_type_SIGNAL " )
160
+ internal func _swift_dispatch_source_type_signal( ) -> dispatch_source_type_t
161
+
162
+ @warn_unused_result
163
+ @asmname ( " _swift_dispatch_source_type_TIMER " )
164
+ internal func _swift_dispatch_source_type_timer( ) -> dispatch_source_type_t
165
+
166
+ @warn_unused_result
167
+ @asmname ( " _swift_dispatch_source_type_WRITE " )
168
+ internal func _swift_dispatch_source_type_write( ) -> dispatch_source_type_t
169
+
170
+ #if _runtime(_ObjC)
171
+ public var DISPATCH_SOURCE_TYPE_MACH_SEND : dispatch_source_type_t {
172
+ return _swift_dispatch_source_type_mach_send ( )
173
+ }
174
+ public var DISPATCH_SOURCE_TYPE_MACH_RECV : dispatch_source_type_t {
175
+ return _swift_dispatch_source_type_mach_recv ( )
176
+ }
177
+ public var DISPATCH_SOURCE_TYPE_MEMORYPRESSURE : dispatch_source_type_t {
178
+ return _swift_dispatch_source_type_memorypressure ( )
179
+ }
180
+ public var DISPATCH_SOURCE_TYPE_PROC : dispatch_source_type_t {
181
+ return _swift_dispatch_source_type_proc ( )
182
+ }
183
+ public var DISPATCH_SOURCE_TYPE_VNODE : dispatch_source_type_t {
184
+ return _swift_dispatch_source_type_vnode ( )
185
+ }
186
+
161
187
@warn_unused_result
162
188
@asmname ( " _swift_dispatch_source_type_MACH_SEND " )
163
189
internal func _swift_dispatch_source_type_mach_send( ) -> dispatch_source_type_t
@@ -175,25 +201,10 @@ internal func _swift_dispatch_source_type_memorypressure()
175
201
@asmname ( " _swift_dispatch_source_type_PROC " )
176
202
internal func _swift_dispatch_source_type_proc( ) -> dispatch_source_type_t
177
203
178
- @warn_unused_result
179
- @asmname ( " _swift_dispatch_source_type_READ " )
180
- internal func _swift_dispatch_source_type_read( ) -> dispatch_source_type_t
181
-
182
- @warn_unused_result
183
- @asmname ( " _swift_dispatch_source_type_SIGNAL " )
184
- internal func _swift_dispatch_source_type_signal( ) -> dispatch_source_type_t
185
-
186
- @warn_unused_result
187
- @asmname ( " _swift_dispatch_source_type_TIMER " )
188
- internal func _swift_dispatch_source_type_timer( ) -> dispatch_source_type_t
189
-
190
204
@warn_unused_result
191
205
@asmname ( " _swift_dispatch_source_type_VNODE " )
192
206
internal func _swift_dispatch_source_type_vnode( ) -> dispatch_source_type_t
193
-
194
- @warn_unused_result
195
- @asmname ( " _swift_dispatch_source_type_WRITE " )
196
- internal func _swift_dispatch_source_type_write( ) -> dispatch_source_type_t
207
+ #endif // _runtime(_ObjC)
197
208
198
209
// dispatch/time.h
199
210
// DISPATCH_TIME_NOW: ok
0 commit comments