From 84b9aad85fc51b0ba81496781512280fabbf1821 Mon Sep 17 00:00:00 2001 From: Stefan Laner Date: Wed, 5 Feb 2014 17:28:03 +0100 Subject: removed poll emulation for windows --- src/CommonAPI/MainLoopContext.h | 16 +++++------- src/CommonAPI/pollStructures.h | 57 ----------------------------------------- 2 files changed, 6 insertions(+), 67 deletions(-) delete mode 100755 src/CommonAPI/pollStructures.h diff --git a/src/CommonAPI/MainLoopContext.h b/src/CommonAPI/MainLoopContext.h index 9c8b200..117bf78 100755 --- a/src/CommonAPI/MainLoopContext.h +++ b/src/CommonAPI/MainLoopContext.h @@ -11,14 +11,15 @@ #include + #ifdef WIN32 - #undef max +#include +#else +#include #endif #ifdef WIN32 -#define COMMONAPI_POLLFD commonapi_pollfd -#else -#define COMMONAPI_POLLFD pollfd + #undef max #endif #include @@ -27,11 +28,6 @@ #include #include -#ifdef WIN32 - #include "pollStructures.h" -#else - #include -#endif namespace CommonAPI { @@ -116,7 +112,7 @@ struct Watch { * * @return The associated file descriptor. */ - virtual const COMMONAPI_POLLFD& getAssociatedFileDescriptor() = 0; + virtual const pollfd& getAssociatedFileDescriptor() = 0; /** * \brief Returns a vector of all dispatch sources that depend on the watched file descriptor. diff --git a/src/CommonAPI/pollStructures.h b/src/CommonAPI/pollStructures.h deleted file mode 100755 index 7eacde3..0000000 --- a/src/CommonAPI/pollStructures.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Header for poll(2) emulation - Contributed by Paolo Bonzini. - - Copyright 2001, 2002, 2003, 2007, 2009, 2010 Free Software Foundation, Inc. - - This file is part of gnulib. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _POLL_STRUCTURES_H -#define _POLL_STRUCTURES_H - -/* fake a poll(2) environment */ -#define POLLIN 0x0001 /* any readable data available */ -#define POLLPRI 0x0002 /* OOB/Urgent readable data */ -#define POLLOUT 0x0004 /* file descriptor is writeable */ -#define POLLERR 0x0008 /* some poll error occurred */ -#define POLLHUP 0x0010 /* file descriptor was "hung up" */ -#define POLLNVAL 0x0020 /* requested events "invalid" */ -#define POLLRDNORM 0x0040 -#define POLLRDBAND 0x0080 -#define POLLWRNORM 0x0100 -#define POLLWRBAND 0x0200 - -#ifdef __cplusplus -extern "C" { -#endif - - - struct commonapi_pollfd - { - unsigned int fd; /* which file descriptor to poll */ - short events; /* events we are interested in */ - short revents; /* events found on return */ - }; - - typedef unsigned long nfds_t; - - //extern int poll(struct commonapi_pollfd *pfd, nfds_t nfd, int timeout); - -#ifdef __cplusplus -} -#endif - -#endif /* _POLL_STRUCTURES_H */ -- cgit v1.2.1