Skip to content

Commit aa1d233

Browse files
committed
add an internal extension so that CFStreamStatus can be converted to a raw value type in a cross platform manner
1 parent 02d422d commit aa1d233

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Foundation/NSStream.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010
import CoreFoundation
1111

12+
#if os(OSX) || os(iOS)
13+
internal extension UInt {
14+
init(_ status: CFStreamStatus) {
15+
self.init(status.rawValue)
16+
}
17+
}
18+
#endif
19+
1220
extension Stream {
1321
public struct PropertyKey : RawRepresentable, Equatable, Hashable, Comparable {
1422
public private(set) var rawValue: String

0 commit comments

Comments
 (0)