Skip to content

Commit f400376

Browse files
committed
[stdlib] Refactoring some ifdef code
Patched for compnerd review in PR #3886.
1 parent 44f9bf0 commit f400376

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

stdlib/private/SwiftPrivateLibcExtras/SwiftPrivateLibcExtras.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,14 @@ public func _stdlib_select(
9898
let writeAddr = writefds.baseAddress
9999
let errorAddr = errorfds.baseAddress
100100
#if CYGWIN
101-
func asFdSetPtr(
102-
_ p: UnsafeMutablePointer<UInt>?
103-
) -> UnsafeMutablePointer<_types_fd_set>? {
104-
return UnsafeMutableRawPointer(p)?
105-
.assumingMemoryBound(to: _types_fd_set.self)
106-
}
107-
#else
101+
typealias fd_set = _types_fd_set
102+
#endif
108103
func asFdSetPtr(
109104
_ p: UnsafeMutablePointer<UInt>?
110105
) -> UnsafeMutablePointer<fd_set>? {
111106
return UnsafeMutableRawPointer(p)?
112107
.assumingMemoryBound(to: fd_set.self)
113108
}
114-
#endif
115109
return select(
116110
_stdlib_FD_SETSIZE,
117111
asFdSetPtr(readAddr),

stdlib/public/Platform/glibc.modulemap.gyb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,10 @@ module SwiftGlibc [system] {
331331
}
332332
% end
333333

334-
% if CMAKE_SDK in ["CYGWIN"]:
335334
module file {
336335
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/file.h"
337336
export *
338337
}
339-
% end
340338

341339
module ipc {
342340
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ipc.h"

0 commit comments

Comments
 (0)