diff options
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/hp-timing.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h index af9d92f..1960a71 100644 --- a/sysdeps/generic/hp-timing.h +++ b/sysdeps/generic/hp-timing.h @@ -32,11 +32,20 @@ typedef uint64_t hp_timing_t; /* The clock_gettime (CLOCK_MONOTONIC) has unspecified starting time, nano-second accuracy, and for some architectues is implemented as vDSO symbol. */ -#define HP_TIMING_NOW(var) \ +#ifdef _ISOMAC +# define HP_TIMING_NOW(var) \ +({ \ + struct timespec tv; \ + clock_gettime (CLOCK_MONOTONIC, &tv); \ + (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ +}) +#else +# define HP_TIMING_NOW(var) \ ({ \ struct __timespec64 tv; \ __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ }) +#endif #endif /* hp-timing.h */ |