THRIFT-5150: Fix compilation with Swift 5.2
- (OS X and Linux) type 'TSet<Element>' does not conform to protocol 'Collection'
- (Linux only) kCFSocketCloseOnInvalidate has Int type
Client: swift
diff --git a/lib/swift/Sources/TSocketServer.swift b/lib/swift/Sources/TSocketServer.swift
index 6cfb5a1..5d0dd49 100644
--- a/lib/swift/Sources/TSocketServer.swift
+++ b/lib/swift/Sources/TSocketServer.swift
@@ -56,7 +56,7 @@
let sock = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, 0, nil, nil)
#endif
if sock != nil {
- CFSocketSetSocketFlags(sock, CFSocketGetSocketFlags(sock) & ~kCFSocketCloseOnInvalidate)
+ CFSocketSetSocketFlags(sock, CFSocketGetSocketFlags(sock) & ~CFOptionFlags(kCFSocketCloseOnInvalidate))
fd = CFSocketGetNative(sock)
var yes = 1