File tree Expand file tree Collapse file tree 9 files changed +34
-5
lines changed
WasmKit/Execution/Runtime Expand file tree Collapse file tree 9 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import class Foundation.ProcessInfo
5
5
6
6
let package = Package (
7
7
name: " WasmKit " ,
8
- platforms: [ . macOS( . v11 ) , . iOS( . v14 ) ] ,
8
+ platforms: [ . macOS( . v10_13 ) , . iOS( . v12 ) ] ,
9
9
products: [
10
10
. library(
11
11
name: " WasmKit " ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import SystemPackage
4
4
import WasmKit
5
5
6
6
@main
7
+ @available ( macOS 11 , * )
7
8
struct Spectest : AsyncParsableCommand {
8
9
@Argument
9
10
var path : String
Original file line number Diff line number Diff line change
1
+ @available ( macOS 11 , * )
1
2
struct ModuleTranslation {
2
3
let diagnostics : DiagnosticCollection
3
4
let typeMapping : TypeMapping
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ public struct SwiftFunctionSource {
49
49
let name : String
50
50
}
51
51
52
+ @available ( macOS 11 , * )
52
53
struct SourceSummaryBuilder {
53
54
let diagnostics : DiagnosticCollection
54
55
let typeMapping : TypeMapping
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ struct SwiftAPIDigester {
116
116
typealias SDKNodeType = SDKNodeInherit < SDKNodeBody , SDKNodeTypeBody >
117
117
typealias SDKNodeTypeNominal = SDKNodeInherit < SDKNodeType , SDKNodeTypeNominalBody >
118
118
119
+ @available ( macOS 11 , * )
119
120
func dumpSDK( moduleName: String , arguments: [ String ] ) throws -> Output {
120
121
var args = [
121
122
" -dump-sdk " ,
Original file line number Diff line number Diff line change
1
+ @available ( macOS 11 , * )
1
2
struct TypeMapping {
2
3
typealias DeclScope = [ SwiftAPIDigester . SDKNodeDecl ]
3
4
struct DeclSource {
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ public struct WITExtractor {
31
31
}
32
32
33
33
public func run( moduleName: String ) throws -> Output {
34
+ guard #available( macOS 11 , * ) else {
35
+ fatalError ( " WITExtractor requires macOS 11+ " )
36
+ }
34
37
let header = """
35
38
// DO NOT EDIT.
36
39
//
@@ -42,6 +45,7 @@ public struct WITExtractor {
42
45
return output
43
46
}
44
47
48
+ @available ( macOS 11 , * )
45
49
func runWithoutHeader( moduleName: String ) throws -> Output {
46
50
let output = try digester. dumpSDK ( moduleName: moduleName, arguments: extraDigesterArguments)
47
51
var typeMapping = TypeMapping ( )
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ struct ExtractWIT: ParsableCommand {
123
123
var digesterArgs : [ String ] = [ ]
124
124
125
125
func run( ) throws {
126
+ guard #available( macOS 11 , * ) else {
127
+ fatalError ( " ExtractWIT requires macOS 11+ " )
128
+ }
129
+
126
130
let extractor = WITExtractor (
127
131
namespace: namespace,
128
132
packageName: packageName,
Original file line number Diff line number Diff line change @@ -157,8 +157,16 @@ struct ValueStack {
157
157
}
158
158
159
159
extension ValueStack : Sequence {
160
- func makeIterator( ) -> some IteratorProtocol {
161
- self . values [ ..< count] . makeIterator ( )
160
+ struct Iterator : IteratorProtocol {
161
+ fileprivate var base : UnsafeMutableBufferPointer < Value > . SubSequence . Iterator
162
+
163
+ mutating func next( ) -> Value ? {
164
+ base. next ( )
165
+ }
166
+ }
167
+
168
+ func makeIterator( ) -> Iterator {
169
+ Iterator ( base: self . values [ ..< count] . makeIterator ( ) )
162
170
}
163
171
}
164
172
@@ -207,8 +215,16 @@ struct FixedSizeStack<Element> {
207
215
}
208
216
209
217
extension FixedSizeStack : Sequence {
210
- func makeIterator( ) -> some IteratorProtocol < Element > {
211
- self . buffer [ ..< numberOfElements] . makeIterator ( )
218
+ struct Iterator : IteratorProtocol {
219
+ fileprivate var base : UnsafeMutableBufferPointer < Element > . SubSequence . Iterator
220
+
221
+ mutating func next( ) -> Element ? {
222
+ base. next ( )
223
+ }
224
+ }
225
+
226
+ func makeIterator( ) -> Iterator {
227
+ Iterator ( base: self . buffer [ ..< numberOfElements] . makeIterator ( ) )
212
228
}
213
229
}
214
230
You can’t perform that action at this time.
0 commit comments