event/PollGroup: check _WIN32 instead of USE_WINSELECT
This commit is contained in:
parent
92fc53ebef
commit
54ee0e28ab
@ -172,12 +172,8 @@ conf.set('HAVE_PRCTL', is_linux)
|
|||||||
conf.set('USE_EVENTFD', is_linux and get_option('eventfd'))
|
conf.set('USE_EVENTFD', is_linux and get_option('eventfd'))
|
||||||
conf.set('USE_SIGNALFD', is_linux and get_option('signalfd'))
|
conf.set('USE_SIGNALFD', is_linux and get_option('signalfd'))
|
||||||
|
|
||||||
if is_windows
|
if is_linux and get_option('epoll')
|
||||||
conf.set('USE_WINSELECT', true)
|
|
||||||
elif is_linux and get_option('epoll')
|
|
||||||
conf.set('USE_EPOLL', true)
|
conf.set('USE_EPOLL', true)
|
||||||
else
|
|
||||||
conf.set('USE_POLL', true)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not get_option('syslog').disabled()
|
if not get_option('syslog').disabled()
|
||||||
|
@ -22,22 +22,24 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef USE_EPOLL
|
#ifdef _WIN32
|
||||||
#include "PollGroupEpoll.hxx"
|
|
||||||
typedef PollResultEpoll PollResult;
|
|
||||||
typedef PollGroupEpoll PollGroup;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_WINSELECT
|
|
||||||
#include "PollGroupWinSelect.hxx"
|
#include "PollGroupWinSelect.hxx"
|
||||||
typedef PollResultGeneric PollResult;
|
typedef PollResultGeneric PollResult;
|
||||||
typedef PollGroupWinSelect PollGroup;
|
typedef PollGroupWinSelect PollGroup;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_POLL
|
#elif defined(USE_EPOLL)
|
||||||
|
|
||||||
|
#include "PollGroupEpoll.hxx"
|
||||||
|
typedef PollResultEpoll PollResult;
|
||||||
|
typedef PollGroupEpoll PollGroup;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#include "PollGroupPoll.hxx"
|
#include "PollGroupPoll.hxx"
|
||||||
typedef PollResultGeneric PollResult;
|
typedef PollResultGeneric PollResult;
|
||||||
typedef PollGroupPoll PollGroup;
|
typedef PollGroupPoll PollGroup;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#ifdef USE_POLL
|
|
||||||
|
|
||||||
#include "PollGroupPoll.hxx"
|
#include "PollGroupPoll.hxx"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -89,5 +85,3 @@ PollGroupPoll::ReadEvents(PollResultGeneric &result, int timeout_ms) noexcept
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#ifdef USE_WINSELECT
|
|
||||||
|
|
||||||
#include "PollGroupWinSelect.hxx"
|
#include "PollGroupWinSelect.hxx"
|
||||||
|
|
||||||
static constexpr int EVENT_READ = 0;
|
static constexpr int EVENT_READ = 0;
|
||||||
@ -165,5 +161,3 @@ PollGroupWinSelect::ReadEvents(PollResultGeneric &result,
|
|||||||
i.second.events = 0;
|
i.second.events = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -4,10 +4,16 @@ if uring_dep.found()
|
|||||||
event_sources += 'UringManager.cxx'
|
event_sources += 'UringManager.cxx'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if is_windows
|
||||||
|
event_sources += 'PollGroupWinSelect.cxx'
|
||||||
|
elif is_linux and get_option('epoll')
|
||||||
|
# epoll support is header-only
|
||||||
|
else
|
||||||
|
event_sources += 'PollGroupPoll.cxx'
|
||||||
|
endif
|
||||||
|
|
||||||
event = static_library(
|
event = static_library(
|
||||||
'event',
|
'event',
|
||||||
'PollGroupPoll.cxx',
|
|
||||||
'PollGroupWinSelect.cxx',
|
|
||||||
'SignalMonitor.cxx',
|
'SignalMonitor.cxx',
|
||||||
'TimerEvent.cxx',
|
'TimerEvent.cxx',
|
||||||
'IdleMonitor.cxx',
|
'IdleMonitor.cxx',
|
||||||
|
Loading…
Reference in New Issue
Block a user