Skip to content

Commit f81a0bd

Browse files
committed
change DispatchSource protocol in Wrapper to match extension prototypes in Source.swift
1 parent 9e4af8b commit f81a0bd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/swift/Source.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import CDispatch
1414

1515
public extension DispatchSourceType {
16-
typealias DispatchSourceHandler = @convention(block) () -> Void
1716

1817
public func setEventHandler(qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], handler: DispatchSourceHandler?) {
1918
if #available(OSX 10.10, iOS 8.0, *), let h = handler where qos != .unspecified || !flags.isEmpty {

src/swift/Wrapper.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,21 @@ extension DispatchSource : DispatchSourceProcess,
167167
}
168168
#endif
169169

170+
public typealias DispatchSourceHandler = @convention(block) () -> Void
171+
170172
public protocol DispatchSourceType {
171-
#if false /* FIXME: crashes the swift compiler */
172-
typealias DispatchSourceHandler = @convention(block) () -> Void
173+
func setEventHandler(qos: DispatchQoS, flags: DispatchWorkItemFlags, handler: DispatchSourceHandler?)
173174

174-
func setEventHandler(handler: DispatchSourceHandler?)
175+
func setEventHandler(handler: DispatchWorkItem)
175176

176-
func setCancelHandler(handler: DispatchSourceHandler?)
177+
func setCancelHandler(qos: DispatchQoS, flags: DispatchWorkItemFlags, handler: DispatchSourceHandler?)
178+
179+
func setCancelHandler(handler: DispatchWorkItem)
180+
181+
func setRegistrationHandler(qos: DispatchQoS, flags: DispatchWorkItemFlags, handler: DispatchSourceHandler?)
182+
183+
func setRegistrationHandler(handler: DispatchWorkItem)
177184

178-
func setRegistrationHandler(handler: DispatchSourceHandler?)
179-
#endif
180185
func cancel()
181186

182187
func resume()

0 commit comments

Comments
 (0)