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:
Jan Vidar Krey
2010-02-10 21:57:27 +01:00
parent 6ac78e1a10
commit 896bbfcb5d
9 changed files with 446 additions and 382 deletions

View File

@@ -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