X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fplatform%2Fposix%2Fos-threads.h;h=fc28fc9017235fcb4804797dbf217cd2da8897c3;hb=28b0f9fb414370ecd61b93722bfd7d129ea009a8;hp=c37beed2bef14f5a0e998c30c953d43968210e2e;hpb=d465a51a29a9a81aade24ba75591b8bac1a57d0c;p=deb_libcec.git diff --git a/src/lib/platform/posix/os-threads.h b/src/lib/platform/posix/os-threads.h index c37beed..fc28fc9 100644 --- a/src/lib/platform/posix/os-threads.h +++ b/src/lib/platform/posix/os-threads.h @@ -49,7 +49,14 @@ namespace PLATFORM inline struct timespec GetAbsTime(uint64_t iIncreaseBy = 0) { struct timespec now; + #ifdef __APPLE__ + struct timeval tv; + gettimeofday(&tv, NULL); + now.tv_sec = tv.tv_sec + 0; + now.tv_nsec = 0; + #else clock_gettime(CLOCK_REALTIME, &now); + #endif now.tv_nsec += iIncreaseBy % 1000 * 1000000; now.tv_sec += iIncreaseBy / 1000 + now.tv_nsec / 1000000000; now.tv_nsec %= 1000000000;