Merge pull request #270 from jrflat/fix-android-stat

Fix Stat build on Android
This commit is contained in:
Jonathan Flat authored and GitHub committed 2025-11-04 10:29:45 -07:00
commit b083113aef
3 files changed
+14 -9

No files matched your search

+5
View File
@@ -45,6 +45,11 @@ jobs:
{"os_version": "focal", "swift_version": "6.2"},
{"os_version": "focal", "swift_version": "nightly-main"},
]
enable_android_sdk_build: true
android_exclude_swift_versions: |
[
{"os_version": "focal", "swift_version": "nightly-main"},
]
build-abi-stable:
name: Build ABI Stable
+8 -8
View File
@@ -280,8 +280,8 @@ public struct Stat: RawRepresentable, Sendable {
/// The corresponding C property is `st_dev`.
@_alwaysEmitIntoClient
public var deviceID: DeviceID {
get { DeviceID(rawValue: rawValue.st_dev) }
set { rawValue.st_dev = newValue.rawValue }
get { DeviceID(rawValue: numericCast(rawValue.st_dev)) }
set { rawValue.st_dev = numericCast(newValue.rawValue) }
}
/// Inode number
@@ -289,8 +289,8 @@ public struct Stat: RawRepresentable, Sendable {
/// The corresponding C property is `st_ino`.
@_alwaysEmitIntoClient
public var inode: Inode {
get { Inode(rawValue: rawValue.st_ino) }
set { rawValue.st_ino = newValue.rawValue }
get { Inode(rawValue: numericCast(rawValue.st_ino)) }
set { rawValue.st_ino = numericCast(newValue.rawValue) }
}
/// File mode
@@ -298,8 +298,8 @@ public struct Stat: RawRepresentable, Sendable {
/// The corresponding C property is `st_mode`.
@_alwaysEmitIntoClient
public var mode: FileMode {
get { FileMode(rawValue: rawValue.st_mode) }
set { rawValue.st_mode = newValue.rawValue }
get { FileMode(rawValue: numericCast(rawValue.st_mode)) }
set { rawValue.st_mode = numericCast(newValue.rawValue) }
}
/// File type for the given mode
@@ -366,8 +366,8 @@ public struct Stat: RawRepresentable, Sendable {
/// The corresponding C property is `st_rdev`.
@_alwaysEmitIntoClient
public var specialDeviceID: DeviceID {
get { DeviceID(rawValue: rawValue.st_rdev) }
set { rawValue.st_rdev = newValue.rawValue }
get { DeviceID(rawValue: numericCast(rawValue.st_rdev)) }
set { rawValue.st_rdev = numericCast(newValue.rawValue) }
}
/// Total size, in bytes
+1 -1
View File
@@ -21,7 +21,7 @@ import Musl
#elseif canImport(WASILibc)
import WASILibc
#elseif canImport(Bionic)
@_implementationOnly import CSystem
import CSystem
import Bionic
#else
#error("Unsupported Platform")