diff --git a/Package.swift b/Package.swift index 40a96045..56e78074 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ import class Foundation.ProcessInfo let package = Package( name: "WasmKit", - platforms: [.macOS(.v11), .iOS(.v14)], + platforms: [.macOS(.v10_13), .iOS(.v12)], products: [ .library( name: "WasmKit", diff --git a/Sources/Spectest/Spectest.swift b/Sources/Spectest/Spectest.swift index 5c7885ce..2fed3c8f 100644 --- a/Sources/Spectest/Spectest.swift +++ b/Sources/Spectest/Spectest.swift @@ -4,6 +4,7 @@ import SystemPackage import WasmKit @main +@available(macOS 11, *) struct Spectest: AsyncParsableCommand { @Argument var path: String diff --git a/Sources/WITExtractor/ModuleTranslation.swift b/Sources/WITExtractor/ModuleTranslation.swift index b08b9249..2a870b2a 100644 --- a/Sources/WITExtractor/ModuleTranslation.swift +++ b/Sources/WITExtractor/ModuleTranslation.swift @@ -1,3 +1,4 @@ +@available(macOS 11, *) struct ModuleTranslation { let diagnostics: DiagnosticCollection let typeMapping: TypeMapping diff --git a/Sources/WITExtractor/SourceSummary.swift b/Sources/WITExtractor/SourceSummary.swift index d9ca457f..6e783911 100644 --- a/Sources/WITExtractor/SourceSummary.swift +++ b/Sources/WITExtractor/SourceSummary.swift @@ -49,6 +49,7 @@ public struct SwiftFunctionSource { let name: String } +@available(macOS 11, *) struct SourceSummaryBuilder { let diagnostics: DiagnosticCollection let typeMapping: TypeMapping diff --git a/Sources/WITExtractor/SwiftAPIDigester.swift b/Sources/WITExtractor/SwiftAPIDigester.swift index f8c42f1e..794776c8 100644 --- a/Sources/WITExtractor/SwiftAPIDigester.swift +++ b/Sources/WITExtractor/SwiftAPIDigester.swift @@ -116,6 +116,7 @@ struct SwiftAPIDigester { typealias SDKNodeType = SDKNodeInherit typealias SDKNodeTypeNominal = SDKNodeInherit + @available(macOS 11, *) func dumpSDK(moduleName: String, arguments: [String]) throws -> Output { var args = [ "-dump-sdk", diff --git a/Sources/WITExtractor/TypeMapping.swift b/Sources/WITExtractor/TypeMapping.swift index 9da4f018..82ad2cb6 100644 --- a/Sources/WITExtractor/TypeMapping.swift +++ b/Sources/WITExtractor/TypeMapping.swift @@ -1,3 +1,4 @@ +@available(macOS 11, *) struct TypeMapping { typealias DeclScope = [SwiftAPIDigester.SDKNodeDecl] struct DeclSource { diff --git a/Sources/WITExtractor/WITExtractor.swift b/Sources/WITExtractor/WITExtractor.swift index cacc2f0d..504dd612 100644 --- a/Sources/WITExtractor/WITExtractor.swift +++ b/Sources/WITExtractor/WITExtractor.swift @@ -31,6 +31,9 @@ public struct WITExtractor { } public func run(moduleName: String) throws -> Output { + guard #available(macOS 11, *) else { + fatalError("WITExtractor requires macOS 11+") + } let header = """ // DO NOT EDIT. // @@ -42,6 +45,7 @@ public struct WITExtractor { return output } + @available(macOS 11, *) func runWithoutHeader(moduleName: String) throws -> Output { let output = try digester.dumpSDK(moduleName: moduleName, arguments: extraDigesterArguments) var typeMapping = TypeMapping() diff --git a/Sources/WITTool/WITTool.swift b/Sources/WITTool/WITTool.swift index de5148ea..9a7faf9b 100644 --- a/Sources/WITTool/WITTool.swift +++ b/Sources/WITTool/WITTool.swift @@ -123,6 +123,10 @@ struct ExtractWIT: ParsableCommand { var digesterArgs: [String] = [] func run() throws { + guard #available(macOS 11, *) else { + fatalError("ExtractWIT requires macOS 11+") + } + let extractor = WITExtractor( namespace: namespace, packageName: packageName, diff --git a/Sources/WasmKit/Execution/Runtime/Stack.swift b/Sources/WasmKit/Execution/Runtime/Stack.swift index a77fffb3..a7f96a66 100644 --- a/Sources/WasmKit/Execution/Runtime/Stack.swift +++ b/Sources/WasmKit/Execution/Runtime/Stack.swift @@ -157,8 +157,16 @@ struct ValueStack { } extension ValueStack: Sequence { - func makeIterator() -> some IteratorProtocol { - self.values[...SubSequence.Iterator + + mutating func next() -> Value? { + base.next() + } + } + + func makeIterator() -> Iterator { + Iterator(base: self.values[.. { } extension FixedSizeStack: Sequence { - func makeIterator() -> some IteratorProtocol { - self.buffer[...SubSequence.Iterator + + mutating func next() -> Element? { + base.next() + } + } + + func makeIterator() -> Iterator { + Iterator(base: self.buffer[..