Removes timespec_get() from Unix systems

This change removes timespec_get() from Unix systems and makes it also possible to cross-compile binaries on macOS Big Sur or macOS Monterrey that target macOS Mojave at minimum since Mojave lacks support for timespec_get().
This commit is contained in:
dob205
2021-11-07 18:00:18 +01:00
committed by GitHub
parent b4ac1042dd
commit 452e2348da

View File

@@ -101,11 +101,7 @@ thread_wait_event(event_t *handle, int timeout)
event_pthread_t *event = (event_pthread_t *)handle;
struct timespec abstime;
#ifdef HAS_TIMESPEC_GET
timespec_get(&abstime, TIME_UTC);
#else
clock_gettime(CLOCK_REALTIME, &abstime);
#endif
abstime.tv_nsec += (timeout % 1000) * 1000000;
abstime.tv_sec += (timeout / 1000);
if (abstime.tv_nsec > 1000000000) {