mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +01:00
Remove duplicate poller decision making
The decision about the poller mechanism to use (select, poll, ...) was done twice: once by the build system and once by the code in poller.hpp. As the build-system can actually detect the mechanisms available, prefer that result to the hard coded defaults in poller.hpp. At the same time, remove the duplicate detection of select() vs. poll()-variant from proxy.cpp, signaler.cpp and zmq.cpp. This patch has not been tested on many build platforms: especially the cmake build needs testing / patching. For the other builds, hard code the result as these these are all Windows platforms.
This commit is contained in:
@@ -18,25 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include "platform.hpp"
|
||||
#include "poller.hpp"
|
||||
#include "proxy.hpp"
|
||||
#include "likely.hpp"
|
||||
|
||||
#if defined ZMQ_FORCE_SELECT
|
||||
#define ZMQ_POLL_BASED_ON_SELECT
|
||||
#elif defined ZMQ_FORCE_POLL
|
||||
#define ZMQ_POLL_BASED_ON_POLL
|
||||
#elif defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
|
||||
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
|
||||
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
|
||||
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
|
||||
defined ZMQ_HAVE_NETBSD
|
||||
#define ZMQ_POLL_BASED_ON_POLL
|
||||
#elif defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS ||\
|
||||
defined ZMQ_HAVE_CYGWIN
|
||||
#define ZMQ_POLL_BASED_ON_SELECT
|
||||
#endif
|
||||
|
||||
// On AIX platform, poll.h has to be included first to get consistent
|
||||
// definition of pollfd structure (AIX uses 'reqevents' and 'retnevents'
|
||||
// instead of 'events' and 'revents' and defines macros to map from POSIX-y
|
||||
|
||||
Reference in New Issue
Block a user