Avoid potential build error

This commit is contained in:
Justine Tunney 2024-09-05 16:11:03 -07:00
parent 03875beadb
commit 0d6ff04b87
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 6 additions and 3 deletions

View file

@ -26,6 +26,7 @@
#include "libc/nt/synchronization.h"
#include "libc/nt/thread.h"
#include "libc/nt/time.h"
#ifdef __x86_64__
#define _CLOCK_REALTIME 0
#define _CLOCK_MONOTONIC 1
@ -112,3 +113,5 @@ textwindows int sys_clock_gettime_nt(int clock, struct timespec *ts) {
return -EINVAL;
}
}
#endif // __x86_64__

View file

@ -40,9 +40,9 @@ static clock_gettime_f *__clock_gettime_get(void) {
return cgt;
} else if (__syslib) {
return (void *)__syslib->__clock_gettime;
#ifdef __x86_64__
} else if (IsWindows()) {
return sys_clock_gettime_nt;
#ifdef __x86_64__
} else if (IsXnu()) {
return sys_clock_gettime_xnu;
#endif

View file

@ -34,7 +34,6 @@
#include "libc/intrin/fds.h"
#include "libc/intrin/kprintf.h"
#include "libc/intrin/nomultics.h"
#include "libc/intrin/safemacros.h"
#include "libc/intrin/strace.h"
#include "libc/intrin/weaken.h"
#include "libc/macros.h"
@ -873,7 +872,8 @@ RestartOperation:
now = timespec_mono();
if (timespec_cmp(now, deadline) >= 0)
return etimedout();
ms = min(-1u, timespec_tomillis(timespec_sub(deadline, now)));
ms = timespec_tomillis(timespec_sub(deadline, now));
ms = ms > -1u ? -1u : ms;
goto RestartOperation;
}
return got;