Compile multiple network backends into the binary and choose which one to use at runtime.
This makes it possible to share more code between the backends and also work around bugs of certain backends on some (versions of) operating systems.
This commit is contained in:
@@ -110,22 +110,18 @@
|
||||
|
||||
#ifdef __linux__
|
||||
#define USE_EPOLL
|
||||
#define HAVE_BACKEND
|
||||
#include <sys/epoll.h>
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
#define USE_KQUEUE
|
||||
#define HAVE_BACKEND
|
||||
#include <sys/event.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BACKEND
|
||||
#define USE_SELECT
|
||||
#ifndef WINSOCK
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__sun__)
|
||||
#undef HAVE_STRNDUP
|
||||
|
||||
Reference in New Issue
Block a user