Made File.Handle a non-copyable struct in the library to adopt Swift 6.4.

This commit is contained in:
2026-09-18 12:18:05 +02:00
parent 95ae01f97a
commit 07c4fce37b
5 changed files with 66 additions and 30 deletions
+13
View File
@@ -422,6 +422,19 @@ enum Mock {
private static func installJSON() {
jsonAPI.initialize(to: playdate_json())
// Pulls one chunk through the reader, as the OS would, and decodes
// it as `null`.
jsonAPI.pointee.decode = { _, reader, outval in
var buffer = [UInt8](repeating: 0, count: 16)
let count = buffer.withUnsafeMutableBufferPointer { buffer in
reader.read?(reader.userdata, buffer.baseAddress, Int32(buffer.count)) ?? -1
}
Mock.record("decode(\(count))")
outval?.pointee = json_value()
outval?.pointee.type = CChar(kJSONNull.rawValue)
return 1
}
jsonAPI.pointee.decodeString = { decoder, _, outval in
guard let decoder else { return 0 }