Enable epoll on linux

This commit is contained in:
Sergey Lyubka committed 2022-08-03 15:07:26 +01:00
1 parent 4702073458
commit 51cb40acd2
8 files changed
+148 -6

No files matched your search

+8 -2
View File
@@ -8,7 +8,9 @@
#include <mach/mach_time.h>
#endif
#if !defined(MG_ENABLE_POLL) && (defined(__linux__) || defined(__APPLE__))
#if !defined(MG_ENABLE_EPOLL) && defined(__linux__)
#define MG_ENABLE_EPOLL 1
#elif !defined(MG_ENABLE_POLL)
#define MG_ENABLE_POLL 1
#endif
@@ -30,11 +32,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(MG_ENABLE_POLL) && MG_ENABLE_POLL
#if defined(MG_ENABLE_EPOLL) && MG_ENABLE_EPOLL
#include <sys/epoll.h>
#elif defined(MG_ENABLE_POLL) && MG_ENABLE_POLL
#include <poll.h>
#else
#include <sys/select.h>
#endif
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>