Skip to content

Commit 257010f

Browse files
dennisweissmannstmontgomery
authored andcommitted
Fix compilation in environments that don't have a UTC clock (#434)
Add a compile time guard for an access of `Test.Clock.Instant.wall`. Resolves: rdar://128629302
1 parent 073aef2 commit 257010f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/Testing/EntryPoints/ABIv0/Encoded/ABIv0.EncodedInstant.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ extension ABIv0 {
2626

2727
init(encoding instant: borrowing Test.Clock.Instant) {
2828
absolute = Double(instant.suspending)
29+
#if !SWT_NO_UTC_CLOCK
2930
since1970 = Double(instant.wall)
31+
#else
32+
since1970 = 0
33+
#endif
3034
}
3135
}
3236
}

0 commit comments

Comments
 (0)