summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ev.c56
-rw-r--r--libev.m48
2 files changed, 37 insertions, 27 deletions
diff --git a/ev.c b/ev.c
index d5bf0fe..c6a0e97 100644
--- a/ev.c
+++ b/ev.c
@@ -52,34 +52,44 @@ extern "C" {
# endif
# endif
-# if HAVE_SELECT && HAVE_SYS_SELECT_H && !defined (EV_USE_SELECT)
-# define EV_USE_SELECT 1
-# else
-# define EV_USE_SELECT 0
+# ifndef EV_USE_SELECT
+# if HAVE_SELECT && HAVE_SYS_SELECT_H
+# define EV_USE_SELECT 1
+# else
+# define EV_USE_SELECT 0
+# endif
# endif
-# if HAVE_POLL && HAVE_POLL_H && !defined (EV_USE_POLL)
-# define EV_USE_POLL 1
-# else
-# define EV_USE_POLL 0
+# ifndef EV_USE_POLL
+# if HAVE_POLL && HAVE_POLL_H
+# define EV_USE_POLL 1
+# else
+# define EV_USE_POLL 0
+# endif
# endif
-
-# if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H && !defined (EV_USE_EPOLL)
-# define EV_USE_EPOLL 1
-# else
-# define EV_USE_EPOLL 0
+
+# ifndef EV_USE_EPOLL
+# if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H
+# define EV_USE_EPOLL 1
+# else
+# define EV_USE_EPOLL 0
+# endif
# endif
-
-# if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H && !defined (EV_USE_KQUEUE)
-# define EV_USE_KQUEUE 1
-# else
-# define EV_USE_KQUEUE 0
+
+# ifndef EV_USE_KQUEUE
+# if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H
+# define EV_USE_KQUEUE 1
+# else
+# define EV_USE_KQUEUE 0
+# endif
# endif
-
-# if HAVE_PORT_H && HAVE_PORT_CREATE && !defined (EV_USE_PORT)
-# define EV_USE_PORT 1
-# else
-# define EV_USE_PORT 0
+
+# ifndef EV_USE_PORT
+# if HAVE_PORT_H && HAVE_PORT_CREATE
+# define EV_USE_PORT 1
+# else
+# define EV_USE_PORT 0
+# endif
# endif
#endif
diff --git a/libev.m4 b/libev.m4
index 1f3ae16..2354a75 100644
--- a/libev.m4
+++ b/libev.m4
@@ -2,14 +2,14 @@ dnl this file is part of libev, do not make local modifications
dnl http://software.schmorp.de/pkg/libev
dnl libev support
-AC_CHECK_HEADERS(sys/epoll.h sys/event.h sys/queue.h port.h)
+AC_CHECK_HEADERS(sys/epoll.h sys/event.h sys/queue.h port.h poll.h sys/select.h)
-AC_CHECK_FUNCS(epoll_ctl kqueue port_create)
+AC_CHECK_FUNCS(epoll_ctl kqueue port_create poll select)
AC_CHECK_FUNC(clock_gettime, [], [
if test -z "$LIBEV_M4_AVOID_LIBRT"; then
- AC_CHECK_LIB(rt, clock_gettime)
- AC_CHECK_FUNCS(clock_gettime)
+ AC_CHECK_LIB(rt, clock_gettime)
+ AC_CHECK_FUNCS(clock_gettime)
fi
])