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:
@@ -101,11 +101,7 @@ thread_wait_event(event_t *handle, int timeout)
|
|||||||
event_pthread_t *event = (event_pthread_t *)handle;
|
event_pthread_t *event = (event_pthread_t *)handle;
|
||||||
struct timespec abstime;
|
struct timespec abstime;
|
||||||
|
|
||||||
#ifdef HAS_TIMESPEC_GET
|
|
||||||
timespec_get(&abstime, TIME_UTC);
|
|
||||||
#else
|
|
||||||
clock_gettime(CLOCK_REALTIME, &abstime);
|
clock_gettime(CLOCK_REALTIME, &abstime);
|
||||||
#endif
|
|
||||||
abstime.tv_nsec += (timeout % 1000) * 1000000;
|
abstime.tv_nsec += (timeout % 1000) * 1000000;
|
||||||
abstime.tv_sec += (timeout / 1000);
|
abstime.tv_sec += (timeout / 1000);
|
||||||
if (abstime.tv_nsec > 1000000000) {
|
if (abstime.tv_nsec > 1000000000) {
|
||||||
|
Reference in New Issue
Block a user