Inserted #if guard for s390x

This commit is contained in:
Takuya Nakaike
2018-04-03 14:45:52 +09:00
parent f2c9b5dd29
commit 2fea7f037f
+7 -5
View File
@@ -153,11 +153,13 @@ public extension fd_set {
@inline(__always)
private static func address(for fd: Int32) -> (Int, Int32) {
var intOffset = Int(fd) / __fd_set_count
if (intOffset % 2 == 0) {
intOffset += 1
} else {
intOffset -= 1
}
#if arch(s390x)
if (intOffset % 2 == 0) {
intOffset += 1
} else {
intOffset -= 1
}
#endif
let bitOffset = Int(fd) % __fd_set_count
let mask = Int32(bitPattern: UInt32(1 << bitOffset))
return (intOffset, mask)