From 22d734e305340a67304c81fdf64dd8662a41874b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 23 Feb 2022 20:30:22 +0100 Subject: util.poll: Restructure to make adding additional system APIs easier --- util-src/poll.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'util-src') diff --git a/util-src/poll.c b/util-src/poll.c index 6c6a4e63..be0f6ffd 100644 --- a/util-src/poll.c +++ b/util-src/poll.c @@ -12,8 +12,10 @@ #include #include -#ifdef __linux__ +#if defined(__linux__) #define USE_EPOLL +#else +#define USE_SELECT #endif #ifdef USE_EPOLL @@ -21,7 +23,8 @@ #ifndef MAX_EVENTS #define MAX_EVENTS 64 #endif -#else +#endif +#ifdef USE_SELECT #include #endif @@ -30,7 +33,8 @@ #ifdef USE_EPOLL #define STATE_MT "util.poll" -#else +#endif +#ifdef USE_SELECT #define STATE_MT "util.poll