mirror of
https://github.com/apple/swift-nio
synced 2026-11-28 05:14:23 +00:00
Add the two remaining non-test, non-NIOFS targets to the Windows CI build list. NIOPerformanceTester builds and runs on Windows. The only obstacle was the `setbuf(stdout, nil)` call: `stdout` is a macro on the Windows CRT that Swift cannot reference directly. Add a `CNIOWindows_setStdoutUnbuffered()` wrapper so the C compiler expands the macro (keeping us correct if its definition ever changes), and call it on Windows. NIOCrashTester cannot function on Windows: its OutputGrepper captures a child process's output through a pipe channel (`NIOPipeBootstrap`), which deliberately `fatalError`s on Windows, and relies on `Foundation.Pipe` fd conversion plus Unix-signal crash detection. Extend the existing `!canImport(Darwin) || os(macOS)` guard with `&& !os(Windows)` across the target so it compiles to a no-op on Windows, just as it already does on the non-macOS Darwin platforms.