]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/generic/hp-timing.h
Update HP_TIMING_NOW for _ISOMAC in sysdeps/generic/hp-timing.h
[thirdparty/glibc.git] / sysdeps / generic / hp-timing.h
index af9d92f7f71bf8442f2832c6aaed91dbf166f474..1960a71c622dec00c21e47dc0ea2a3bacf77227b 100644 (file)
@@ -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 */