Fix: redefinition of USEC_PER_SEC macro on macOS
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Sep 2019 15:56:02 +0000 (11:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Sep 2019 17:22:13 +0000 (13:22 -0400)
USEC_PER_SEC is defined by system headers on macOS, resulting in
a warning that it is redefined in time.h. Define it conditionally.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/time.h

index dc07633e968b41eb8d7e2387f78a5aa43c749ac4..60d0a9bd5dcd8aa7faa56e8577d2e1f2e381ce0f 100644 (file)
@@ -27,7 +27,9 @@
 #define NSEC_PER_SEC    1000000000ULL
 #define NSEC_PER_MSEC   1000000ULL
 #define NSEC_PER_USEC   1000ULL
 #define NSEC_PER_SEC    1000000000ULL
 #define NSEC_PER_MSEC   1000000ULL
 #define NSEC_PER_USEC   1000ULL
+#ifndef USEC_PER_SEC
 #define USEC_PER_SEC    1000000ULL
 #define USEC_PER_SEC    1000000ULL
+#endif
 #define USEC_PER_MSEC   1000ULL
 
 #define SEC_PER_MINUTE  60ULL
 #define USEC_PER_MSEC   1000ULL
 
 #define SEC_PER_MINUTE  60ULL
This page took 0.032937 seconds and 4 git commands to generate.