Skip to content

Commit e133abb

Browse files
committed
Fix Stat build on Android
1 parent b11b33a commit e133abb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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)