From 2fea7f037f2b7fc67357ea3397ba4c8bb9e9ab67 Mon Sep 17 00:00:00 2001 From: Takuya Nakaike Date: Tue, 3 Apr 2018 14:45:52 +0900 Subject: [PATCH] Inserted #if guard for s390x --- Sources/Socket/SocketUtils.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Sources/Socket/SocketUtils.swift b/Sources/Socket/SocketUtils.swift index 954118a..c0f7a59 100644 --- a/Sources/Socket/SocketUtils.swift +++ b/Sources/Socket/SocketUtils.swift @@ -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)