Skip to content

Commit 77f4c3a

Browse files
[wasm] Fix WASI build by using time_t for tv_sec (#1348)
`time_t` is defined as `Int64` in wasi-libc, not `Int`.
1 parent 7037e25 commit 77f4c3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/FileManager/FileManager+Files.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ extension _FileManagerImpl {
965965

966966
if let date = attributes[.modificationDate] as? Date {
967967
let (isecs, fsecs) = modf(date.timeIntervalSince1970)
968-
if let tv_sec = Int(exactly: isecs),
968+
if let tv_sec = time_t(exactly: isecs),
969969
let tv_nsec = Int(exactly: round(fsecs * 1000000000.0)) {
970970
var timespecs = (timespec(), timespec())
971971
timespecs.0.tv_sec = tv_sec

0 commit comments

Comments
 (0)