Adopted Span and MutableSpan for buffers across the library to adapt to Swift 6.4.

This commit is contained in:
2026-09-18 12:06:21 +02:00
parent 89c8d7a04c
commit 4cb0f8f500
18 changed files with 127 additions and 83 deletions
+6 -2
View File
@@ -307,8 +307,12 @@ extension System {
/// Sends data over the mirror connection. Returns `false` if mirroring is
/// not active or the send fails.
@discardableResult
public static func sendMirrorData(command: UInt8, data: UnsafeMutableRawBufferPointer) -> Bool {
api.pointee.sendMirrorData.unsafelyUnwrapped(command, data.baseAddress, Int32(data.count))
public static func sendMirrorData(command: UInt8, data: Span<UInt8>) -> Bool {
data.withUnsafeBufferPointer { buffer in
// The C API takes a non-const pointer but only reads the data.
api.pointee.sendMirrorData.unsafelyUnwrapped(
command, UnsafeMutableRawPointer(mutating: buffer.baseAddress), Int32(buffer.count))
}
}
/// OS, language, and pdx version information.