mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Disable GET_TIME on Mac.
- This should fix the Mac version not compiling in issue #85.
This commit is contained in:
parent
d893a489d6
commit
04613bd5b3
|
@ -28,7 +28,15 @@
|
|||
#include <time.h>
|
||||
|
||||
#define CLOCK_T struct timespec
|
||||
|
||||
#ifdef __MACH__
|
||||
// Workaround Mac OS not having clock_gettime.
|
||||
// ToDo: Use mach_absolute_time or something to implement GET_TIME.
|
||||
#define GET_TIME(clock_t) memset((clock_t), 0, sizeof(CLOCK_T))
|
||||
#else
|
||||
#define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))
|
||||
#endif
|
||||
|
||||
#define CLOCK_T_AS_DOUBLE(ts) ((double)((ts).tv_sec) + (double)((ts).tv_nsec) / (double)1000000000L)
|
||||
#define CLOCK_T_DIFF(start, stop) ((double)((stop).tv_sec - (start).tv_sec) + (double)((stop).tv_nsec - (start).tv_nsec) / (double)1000000000L)
|
||||
|
||||
|
|
Loading…
Reference in a new issue