repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added Doxyfile to generate Doxygen documentation. to update your copy of the document...
[deb_libcec.git]
/
src
/
lib
/
platform
/
posix
/
os-threads.h
diff --git
a/src/lib/platform/posix/os-threads.h
b/src/lib/platform/posix/os-threads.h
index c37beed2bef14f5a0e998c30c953d43968210e2e..8b56731adfa2918f2a290e71dd4acc62ce2b7709 100644
(file)
--- 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;
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;
+ now.tv_nsec = tv.tv_usec * 1000;
+ #else
clock_gettime(CLOCK_REALTIME, &now);
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;
now.tv_nsec += iIncreaseBy % 1000 * 1000000;
now.tv_sec += iIncreaseBy / 1000 + now.tv_nsec / 1000000000;
now.tv_nsec %= 1000000000;