-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathStringParameter.swift
More file actions
33 lines (29 loc) · 1.08 KB
/
StringParameter.swift
File metadata and controls
33 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
// DO NOT EDIT.
//
// To update this file, just rebuild your project or run
// `swift package bridge-js`.
@_spi(JSObject_id) import JavaScriptKit
#if arch(wasm32)
@_extern(wasm, module: "bjs", name: "return_string")
private func _return_string(_ ptr: UnsafePointer<UInt8>?, _ len: Int32)
@_extern(wasm, module: "bjs", name: "init_memory")
private func _init_memory(_ sourceId: Int32, _ ptr: UnsafeMutablePointer<UInt8>?)
@_extern(wasm, module: "bjs", name: "swift_js_retain")
private func _swift_js_retain(_ ptr: Int32) -> Int32
@_extern(wasm, module: "bjs", name: "swift_js_throw")
private func _swift_js_throw(_ id: Int32)
#endif
@_expose(wasm, "bjs_checkString")
@_cdecl("bjs_checkString")
public func _bjs_checkString(aBytes: Int32, aLen: Int32) -> Void {
#if arch(wasm32)
let a = String(unsafeUninitializedCapacity: Int(aLen)) { b in
_init_memory(aBytes, b.baseAddress.unsafelyUnwrapped)
return Int(aLen)
}
checkString(a: a)
#else
fatalError("Only available on WebAssembly")
#endif
}