Skip to content

Commit c82c26b

Browse files
committed
event: support CLOCK_WALL on Windows
This is needed for XCTest to run its test suite.
1 parent e92ca67 commit c82c26b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/event/event_windows.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ _dispatch_timer_callback(PTP_CALLBACK_INSTANCE Instance, PVOID Context,
104104
void
105105
_dispatch_event_loop_timer_arm(uint32_t tidx,
106106
dispatch_timer_delay_s range,
107-
dispatch_clock_now_cache_t nows DISPATCH_UNUSED)
107+
dispatch_clock_now_cache_t nows)
108108
{
109109
dispatch_windows_timeout_t timer;
110110
FILETIME ftDueTime;
@@ -113,9 +113,9 @@ _dispatch_event_loop_timer_arm(uint32_t tidx,
113113
switch (DISPATCH_TIMER_CLOCK(tidx)) {
114114
case DISPATCH_CLOCK_WALL:
115115
timer = &_dispatch_windows_timeout[DISPATCH_CLOCK_WALL];
116-
117-
WIN_PORT_ERROR();
118-
__assume(0);
116+
liTime.QuadPart = range.delay +
117+
_dispatch_time_now_cached(DISPATCH_TIMER_CLOCK(tidx), nows);
118+
break;
119119

120120
case DISPATCH_CLOCK_UPTIME:
121121
case DISPATCH_CLOCK_MONOTONIC:
@@ -149,9 +149,7 @@ _dispatch_event_loop_timer_delete(uint32_t tidx)
149149
switch (DISPATCH_TIMER_CLOCK(tidx)) {
150150
case DISPATCH_CLOCK_WALL:
151151
timer = &_dispatch_windows_timeout[DISPATCH_CLOCK_WALL];
152-
153-
WIN_PORT_ERROR();
154-
__assume(0);
152+
break;
155153

156154
case DISPATCH_CLOCK_UPTIME:
157155
case DISPATCH_CLOCK_MONOTONIC:

0 commit comments

Comments
 (0)