summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Laner <laner@itestra.de>2014-02-05 17:28:03 +0100
committerStefan Laner <laner@itestra.de>2014-02-05 17:28:03 +0100
commit84b9aad85fc51b0ba81496781512280fabbf1821 (patch)
tree732d805f8c4bfa82f0fa230e59f1d5390e13a057
parente41d78a3782525feb1bf0ae6084bb60ffa91b8bb (diff)
downloadgenivi-common-api-runtime-84b9aad85fc51b0ba81496781512280fabbf1821.tar.gz
removed poll emulation for windows
-rwxr-xr-xsrc/CommonAPI/MainLoopContext.h16
-rwxr-xr-xsrc/CommonAPI/pollStructures.h57
2 files changed, 6 insertions, 67 deletions
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 <stdint.h>
+
#ifdef WIN32
- #undef max
+#include <WinSock2.h>
+#else
+#include <poll.h>
#endif
#ifdef WIN32
-#define COMMONAPI_POLLFD commonapi_pollfd
-#else
-#define COMMONAPI_POLLFD pollfd
+ #undef max
#endif
#include <limits>
@@ -27,11 +28,6 @@
#include <chrono>
#include <functional>
-#ifdef WIN32
- #include "pollStructures.h"
-#else
- #include <poll.h>
-#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 */