summaryrefslogtreecommitdiff
path: root/src/poll.hpp
diff options
context:
space:
mode:
authorGabriele Svelto <gabriele.svelto@gmail.com>2012-04-30 21:14:04 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-05-02 09:44:04 +0200
commit357a20ef6feae94c033eed392b025e57fe8eaa81 (patch)
treecf3c151ea004d762d5f1f967a1d49c4c2e6a3229 /src/poll.hpp
parent971cbeda3de6691b212ad18bed9e9f08b278cfe1 (diff)
Conditionally include header files required by select() and poll()
Feature checks are introduced to check for all the headers required by the select() and poll() calls. Include files are then included conditionally without the use of any OS-specific directive. The change also fixes a couple of problems: - Fixed compilation under FreeBSD, NetBSD and OpenBSD when forcing the use of select() in the poller - Quieted a warning mixed-sign comparison warning on FreeBSD caused by FD_SETSIZE being declared as an unsigned constant on that OS - Removed the obsolescent AC_HEADER_TIME macro from the configure script Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
Diffstat (limited to 'src/poll.hpp')
-rw-r--r--src/poll.hpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/poll.hpp b/src/poll.hpp
index c192a77..879f4ee 100644
--- a/src/poll.hpp
+++ b/src/poll.hpp
@@ -26,8 +26,22 @@
#if defined XS_USE_ASYNC_POLL
-#include <poll.h>
#include <stddef.h>
+
+#if HAVE_SYS_TYPES
+# include <sys/types.h>
+#endif
+
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+
+#if HAVE_POLL_H
+# include <poll.h>
+#elif HAVE_SYS_POLL_H
+# include <sys/poll.h>
+#endif
+
#include <vector>
#include "fd.hpp"