Skip to content

Commit 5f41d74

Browse files
committed
Revert "Remove a workaround for varargs not compiling on WASI."
This reverts commit 3f1018f.
1 parent 3f1018f commit 5f41d74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/Testing/Events/TimeValue.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ extension TimeValue: Codable {}
8181

8282
extension TimeValue: CustomStringConvertible {
8383
var description: String {
84+
#if os(WASI)
85+
// BUG: https://github.com/swiftlang/swift/issues/72398
86+
return String(describing: Duration(self))
87+
#else
8488
let (secondsFromAttoseconds, attosecondsRemaining) = attoseconds.quotientAndRemainder(dividingBy: 1_000_000_000_000_000_000)
8589
let seconds = seconds + secondsFromAttoseconds
8690
var milliseconds = attosecondsRemaining / 1_000_000_000_000_000
@@ -94,6 +98,7 @@ extension TimeValue: CustomStringConvertible {
9498
}
9599
return String(cString: buffer.baseAddress!)
96100
}
101+
#endif
97102
}
98103
}
99104

0 commit comments

Comments
 (0)