mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-13 05:49:57 +02:00
fix(apple): realign UI layer with regenerated core bindings
- map the new VnidropError cases (DeviceUnavailable, OfferTimeout, RelayPolicyIncompatible, ProtocolIncompatible) to existing catalog keys - drop the stale .map(\.share) now that sharePickedFiles returns Share - remove the duplicate .transfersChanged pattern in the signal switch - replace the deprecated String(cString:) sysctl decode - close the CoreGateway protocol declaration
This commit is contained in:
@@ -42,9 +42,10 @@ private struct MacDeviceInfoProvider: DeviceInfoProvider {
|
||||
var size = 0
|
||||
sysctlbyname("hw.model", nil, &size, nil, 0)
|
||||
guard size > 0 else { return nil }
|
||||
var model = [CChar](repeating: 0, count: size)
|
||||
var model = [UInt8](repeating: 0, count: size)
|
||||
sysctlbyname("hw.model", &model, &size, nil, 0)
|
||||
return String(cString: model)
|
||||
// sysctl reports a NUL-terminated C string; drop the terminator(s).
|
||||
return String(decoding: model.prefix(while: { $0 != 0 }), as: UTF8.self)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user