From 357a20ef6feae94c033eed392b025e57fe8eaa81 Mon Sep 17 00:00:00 2001 From: Gabriele Svelto Date: Mon, 30 Apr 2012 21:14:04 +0200 Subject: 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 --- src/signaler.hpp | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'src/signaler.hpp') diff --git a/src/signaler.hpp b/src/signaler.hpp index a47763f..b94858f 100644 --- a/src/signaler.hpp +++ b/src/signaler.hpp @@ -29,20 +29,37 @@ // instead of 'events' and 'revents' and defines macros to map from POSIX-y // names to AIX-specific names). #if defined XS_USE_SYNC_POLL -#include +# if HAVE_SYS_TYPES +# include +# endif +# if HAVE_SYS_SELECT_H +# include +# endif +# if HAVE_POLL_H +# include +# elif HAVE_SYS_POLL_H +# include +# endif #elif defined XS_USE_SYNC_SELECT -#if defined XS_HAVE_WINDOWS -#include "windows.hpp" -#elif defined XS_HAVE_HPUX -#include -#include -#include -#elif defined XS_HAVE_OPENVMS -#include -#include -#else -#include -#endif +# if defined XS_HAVE_WINDOWS +# include "windows.hpp" +# else +# if HAVE_SYS_TYPES_H +# include +# endif +# if HAVE_SYS_TIME_H +# include +# endif +# if HAVE_TIME_H +# include +# endif +# if HAVE_UNISTD_H +# include +# endif +# if HAVE_SYS_SELECT_H +# include +# endif +# endif #endif namespace xs -- cgit v1.2.3