another fix

This commit is contained in:
2026-05-19 04:11:07 -04:00
parent bae6dcf255
commit 282606dbc4
+5 -1
View File
@@ -13,7 +13,11 @@ nonisolated(unsafe) let _stderr = stderr
struct StandardError: TextOutputStream {
mutating func write(_ string: String) {
for byte in string.utf8 { putc(numericCast(byte), _stderr) }
let utf8 = string.utf8
utf8.withContiguousStorageIfAvailable { _ = fwrite($0.baseAddress, 1, $0.count, _stderr) } ?? {
var buf = Array(utf8);
fwrite(&buf, 1, buf.count, _stderr)
}()
}
}
nonisolated(unsafe) var standardError: StandardError = StandardError()