summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--ev.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/Changes b/Changes
index 097c391..60258e4 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,8 @@ Revision history for libev, a high-performance and full-featured event loop.
is so uncontrollably lame that it requires this. this means that
switching off oobinline is not supported (but tcp/ip doesn't
have oob, so that would be stupid anyways.
+ - use posix module symbol to auto-detect monotonic clock presence
+ and some other default values.
3.41 Fri May 23 18:42:54 CEST 2008
- work around an obscure bug in winsocket select: if you
diff --git a/ev.c b/ev.c
index 6c70810..e75e545 100644
--- a/ev.c
+++ b/ev.c
@@ -166,7 +166,11 @@ extern "C" {
/* this block tries to deduce configuration from header-defined symbols and defaults */
#ifndef EV_USE_MONOTONIC
-# define EV_USE_MONOTONIC 0
+# if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
+# define EV_USE_MONOTONIC 1
+# else
+# define EV_USE_MONOTONIC 0
+# endif
#endif
#ifndef EV_USE_REALTIME
@@ -174,7 +178,11 @@ extern "C" {
#endif
#ifndef EV_USE_NANOSLEEP
-# define EV_USE_NANOSLEEP 0
+# if _POSIX_C_SOURCE >= 199309L
+# define EV_USE_NANOSLEEP 1
+# else
+# define EV_USE_NANOSLEEP 0
+# endif
#endif
#ifndef EV_USE_SELECT