We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d13f845 commit db34d9fCopy full SHA for db34d9f
Sources/NIOEmbedded/Embedded.swift
@@ -32,6 +32,8 @@ import Darwin
32
@preconcurrency import Android
33
#elseif canImport(WASILibc)
34
@preconcurrency import WASILibc
35
+#elseif canImport(WinSDK)
36
+@preconcurrency import WinSDK
37
#else
38
#error("Unknown C library.")
39
#endif
@@ -41,7 +43,12 @@ private func printError(_ string: StaticString) {
41
43
var buf = buf
42
44
while buf.count > 0 {
45
// 2 is stderr
46
+ #if canImport(WinSDK)
47
+ let rc = _write(2, buf.baseAddress, UInt32(truncatingIfNeeded: buf.count))
48
+ let errno = GetLastError()
49
+ #else
50
let rc = write(2, buf.baseAddress, buf.count)
51
+ #endif
52
if rc < 0 {
53
let err = errno
54
if err == EINTR { continue }
0 commit comments