Skip to content

Commit d9b4c5d

Browse files
committed
UTIME_OMIT/UTIME_NOW only available in Musl-based libcs
1 parent 72eade3 commit d9b4c5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/SystemExtras/Clock.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,20 @@ extension Clock {
111111

112112
@_alwaysEmitIntoClient
113113
public static var now: TimeSpec {
114+
#if os(WASI)
114115
return TimeSpec(rawValue: CInterop.TimeSpec(tv_sec: 0, tv_nsec: Int(UTIME_NOW)))
116+
#else
117+
return TimeSpec(rawValue: CInterop.TimeSpec(tv_sec: 0, tv_nsec: Int(_UTIME_NOW)))
118+
#endif
115119
}
116120

117121
@_alwaysEmitIntoClient
118122
public static var omit: TimeSpec {
123+
#if os(WASI)
119124
return TimeSpec(rawValue: CInterop.TimeSpec(tv_sec: 0, tv_nsec: Int(UTIME_OMIT)))
125+
#else
126+
return TimeSpec(rawValue: CInterop.TimeSpec(tv_sec: 0, tv_nsec: Int(_UTIME_OMIT)))
127+
#endif
120128
}
121129
}
122130
}

0 commit comments

Comments
 (0)