From ea9ac1c4831d14118372ce7e1dcebd142c74e7f3 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Wed, 17 Jan 2024 09:52:10 -0500 Subject: [PATCH] Expose the error to the `os(WASI)` build. This should let `AsyncMessageSequency.swift` build. --- Sources/SwiftProtobuf/BinaryDelimited.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftProtobuf/BinaryDelimited.swift b/Sources/SwiftProtobuf/BinaryDelimited.swift index 3edbae447..a529e6d75 100644 --- a/Sources/SwiftProtobuf/BinaryDelimited.swift +++ b/Sources/SwiftProtobuf/BinaryDelimited.swift @@ -14,6 +14,7 @@ #if !os(WASI) import Foundation +#endif /// Helper methods for reading/writing messages with a length prefix. public enum BinaryDelimited { @@ -47,6 +48,7 @@ public enum BinaryDelimited { case noBytesAvailable } +#if !os(WASI) /// Serialize a single size-delimited message to the given stream. Delimited /// format allows a single file or stream to contain multiple messages, /// whereas normally writing multiple non-delimited messages to the same @@ -222,8 +224,10 @@ public enum BinaryDelimited { partial: partial, options: options) } +#endif // !os(WASI) } +#if !os(WASI) // TODO: This should go away when encoding/decoding are more stream based // as that should provide a more direct way to do this. This is basically // a rewrite of BinaryDecoder.decodeVarint(). @@ -268,4 +272,4 @@ internal func decodeVarint(_ stream: InputStream) throws -> UInt64 { } } } -#endif +#endif // !os(WASI)