aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/posix/posix_config.h')
-rw-r--r--src/platform/posix/posix_config.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/platform/posix/posix_config.h b/src/platform/posix/posix_config.h
index 1510d739..6d282f63 100644
--- a/src/platform/posix/posix_config.h
+++ b/src/platform/posix/posix_config.h
@@ -38,12 +38,17 @@
#include <time.h>
+// MacOS X used to lack CLOCK_MONOTONIC. Now it has it, but its
+// buggy, condition variables set to use it wake early.
+#ifdef __APPLE__
+#define NNG_USE_CLOCKID CLOCK_REALTIME
+#endif // __APPLE__
+
+#define NNG_USE_CLOCKID CLOCK_REALTIME
#ifndef CLOCK_REALTIME
#define NNG_USE_GETTIMEOFDAY
#elif !defined(NNG_USE_CLOCKID)
-#ifdef CLOCK_MONOTONIC
#define NNG_USE_CLOCKID CLOCK_MONOTONIC
#else
#define NNG_USE_CLOCKID CLOCK_REALTIME
-#endif
#endif // CLOCK_REALTIME