Skip to content

Commit b083113

Browse files
authored
Merge pull request #270 from jrflat/fix-android-stat
Fix Stat build on Android
2 parents b11b33a + f9a2b94 commit b083113

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/pull_request.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
{"os_version": "focal", "swift_version": "6.2"},
4646
{"os_version": "focal", "swift_version": "nightly-main"},
4747
]
48+
enable_android_sdk_build: true
49+
android_exclude_swift_versions: |
50+
[
51+
{"os_version": "focal", "swift_version": "nightly-main"},
52+
]
4853
4954
build-abi-stable:
5055
name: Build ABI Stable

Sources/System/FileSystem/Stat.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,26 +280,26 @@ public struct Stat: RawRepresentable, Sendable {
280280
/// The corresponding C property is `st_dev`.
281281
@_alwaysEmitIntoClient
282282
public var deviceID: DeviceID {
283-
get { DeviceID(rawValue: rawValue.st_dev) }
284-
set { rawValue.st_dev = newValue.rawValue }
283+
get { DeviceID(rawValue: numericCast(rawValue.st_dev)) }
284+
set { rawValue.st_dev = numericCast(newValue.rawValue) }
285285
}
286286

287287
/// Inode number
288288
///
289289
/// The corresponding C property is `st_ino`.
290290
@_alwaysEmitIntoClient
291291
public var inode: Inode {
292-
get { Inode(rawValue: rawValue.st_ino) }
293-
set { rawValue.st_ino = newValue.rawValue }
292+
get { Inode(rawValue: numericCast(rawValue.st_ino)) }
293+
set { rawValue.st_ino = numericCast(newValue.rawValue) }
294294
}
295295

296296
/// File mode
297297
///
298298
/// The corresponding C property is `st_mode`.
299299
@_alwaysEmitIntoClient
300300
public var mode: FileMode {
301-
get { FileMode(rawValue: rawValue.st_mode) }
302-
set { rawValue.st_mode = newValue.rawValue }
301+
get { FileMode(rawValue: numericCast(rawValue.st_mode)) }
302+
set { rawValue.st_mode = numericCast(newValue.rawValue) }
303303
}
304304

305305
/// File type for the given mode
@@ -366,8 +366,8 @@ public struct Stat: RawRepresentable, Sendable {
366366
/// The corresponding C property is `st_rdev`.
367367
@_alwaysEmitIntoClient
368368
public var specialDeviceID: DeviceID {
369-
get { DeviceID(rawValue: rawValue.st_rdev) }
370-
set { rawValue.st_rdev = newValue.rawValue }
369+
get { DeviceID(rawValue: numericCast(rawValue.st_rdev)) }
370+
set { rawValue.st_rdev = numericCast(newValue.rawValue) }
371371
}
372372

373373
/// Total size, in bytes

Sources/System/Internals/CInterop.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Musl
2121
#elseif canImport(WASILibc)
2222
import WASILibc
2323
#elseif canImport(Bionic)
24-
@_implementationOnly import CSystem
24+
import CSystem
2525
import Bionic
2626
#else
2727
#error("Unsupported Platform")

0 commit comments

Comments
 (0)