Skip to content

Commit 4f17bf5

Browse files
committed
Fix formatting and iOS compatibility
1 parent 1309bae commit 4f17bf5

File tree

4 files changed

+44
-43
lines changed

4 files changed

+44
-43
lines changed

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let DarwinPlatforms: [Platform] = [.macOS, .iOS, .watchOS, .tvOS, .visionOS]
88

99
let package = Package(
1010
name: "WasmKit",
11-
platforms: [.macOS(.v14), .iOS(.v12)],
11+
platforms: [.macOS(.v14), .iOS(.v13)],
1212
products: [
1313
.executable(name: "wasmkit-cli", targets: ["CLI"]),
1414
.library(name: "WasmKit", targets: ["WasmKit"]),

Sources/WasmKit/Execution/Errors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ struct Backtrace: CustomStringConvertible, Sendable {
1717

1818
var description: String {
1919
switch self {
20-
case .iseq(let pc): "iseq(\(Int(bitPattern: pc)))"
21-
case .wasm(let wasmAddress): "wasm(\(wasmAddress))"
20+
case .iseq(let pc): "iseq(\(Int(bitPattern: pc)))"
21+
case .wasm(let wasmAddress): "wasm(\(wasmAddress))"
2222
}
2323
}
2424
}

Sources/WasmKit/Module.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,17 @@ public struct Module {
138138
Instance(handle: try self.instantiateHandle(store: store, imports: imports), store: store)
139139
}
140140

141-
#if WasmDebuggingSupport
142-
/// Instantiate this module in the given imports.
143-
///
144-
/// - Parameters:
145-
/// - store: The ``Store`` to allocate the instance in.
146-
/// - imports: The imports to use for instantiation. All imported entities
147-
/// must be allocated in the given store.
148-
public func instantiate(store: Store, imports: Imports = [:], isDebuggable: Bool) throws -> Instance {
149-
Instance(handle: try self.instantiateHandle(store: store, imports: imports, isDebuggable: isDebuggable), store: store)
150-
}
151-
#endif
141+
#if WasmDebuggingSupport
142+
/// Instantiate this module in the given imports.
143+
///
144+
/// - Parameters:
145+
/// - store: The ``Store`` to allocate the instance in.
146+
/// - imports: The imports to use for instantiation. All imported entities
147+
/// must be allocated in the given store.
148+
public func instantiate(store: Store, imports: Imports = [:], isDebuggable: Bool) throws -> Instance {
149+
Instance(handle: try self.instantiateHandle(store: store, imports: imports, isDebuggable: isDebuggable), store: store)
150+
}
151+
#endif
152152

153153
/// > Note:
154154
/// <https://webassembly.github.io/spec/core/exec/modules.html#instantiation>

Sources/WasmKitGDBHandler/WasmKitDebugger.swift

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,44 @@ package actor WasmKitDebugger {
1919
let responseKind: GDBTargetResponse.Kind
2020
logger.trace("handling GDB host command", metadata: ["GDBHostCommand": .string(command.kind.rawValue)])
2121

22-
responseKind = switch command.kind {
23-
case .startNoAckMode, .isThreadSuffixSupported, .listThreadsInStopReply:
24-
.ok
22+
responseKind =
23+
switch command.kind {
24+
case .startNoAckMode, .isThreadSuffixSupported, .listThreadsInStopReply:
25+
.ok
2526

26-
case .hostInfo:
27-
.keyValuePairs([
28-
"arch": "wasm32",
29-
"ptrsize": "4",
30-
"endian": "little",
31-
"ostype": "wasip1",
32-
"vendor": "WasmKit",
33-
])
27+
case .hostInfo:
28+
.keyValuePairs([
29+
"arch": "wasm32",
30+
"ptrsize": "4",
31+
"endian": "little",
32+
"ostype": "wasip1",
33+
"vendor": "WasmKit",
34+
])
3435

35-
case .supportedFeatures:
36-
// FIXME: should return a different set of supported features instead of echoing.
37-
.raw(command.arguments)
36+
case .supportedFeatures:
37+
// FIXME: should return a different set of supported features instead of echoing.
38+
.raw(command.arguments)
3839

39-
case .vContSupportedActions:
40-
.vContSupportedActions([.continue, .step, .stop])
40+
case .vContSupportedActions:
41+
.vContSupportedActions([.continue, .step, .stop])
4142

42-
case .isVAttachOrWaitSupported, .enableErrorStrings:
43-
.empty
44-
case .processInfo:
45-
.raw("pid:1;parent-pid:1;arch:wasm32;endian:little;ptrsize:4;")
43+
case .isVAttachOrWaitSupported, .enableErrorStrings:
44+
.empty
45+
case .processInfo:
46+
.raw("pid:1;parent-pid:1;arch:wasm32;endian:little;ptrsize:4;")
4647

47-
case .currentThreadID:
48-
.raw("QC1")
48+
case .currentThreadID:
49+
.raw("QC1")
4950

50-
case .firstThreadInfo:
51-
.raw("m1")
51+
case .firstThreadInfo:
52+
.raw("m1")
5253

53-
case .subsequentThreadInfo:
54-
.raw("l")
54+
case .subsequentThreadInfo:
55+
.raw("l")
5556

56-
case .generalRegisters:
57-
fatalError()
58-
}
57+
case .generalRegisters:
58+
fatalError()
59+
}
5960

6061
defer {
6162
if command.kind == .startNoAckMode {

0 commit comments

Comments
 (0)