From a03730632e73d7809b352eb43007036f11deb746 Mon Sep 17 00:00:00 2001 From: Gabriele Svelto Date: Tue, 8 May 2012 19:11:29 +0200 Subject: Move inclusion of select() and poll() headers to a single place Signed-off-by: Gabriele Svelto --- src/polling.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/polling.hpp') diff --git a/src/polling.hpp b/src/polling.hpp index c0b2423..1854705 100644 --- a/src/polling.hpp +++ b/src/polling.hpp @@ -65,4 +65,33 @@ #error No polling mechanism available! #endif +// Conditionally include header files that might be required to use the poll() +// or select() functions + +#if defined XS_HAVE_WINDOWS // Windows-specific header files +# include "windows.h" +# include "winsock2.h" +#else // Header files for Unix-like operating systems +# if HAVE_SYS_TYPES +# 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 +# if HAVE_POLL_H +# include +# elif HAVE_SYS_POLL_H +# include +# endif #endif + +#endif // __XS_POLLING_HPP_INCLUDED__ -- cgit v1.2.3