From: Nick Mathewson Date: Wed, 23 Sep 2009 23:51:26 +0000 (+0000) Subject: Forward-port: fix android compilation X-Git-Tag: release-2.0.3-alpha~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18fe400805699b6d60bfc26896294a34c6990756;p=libevent Forward-port: fix android compilation svn:r1435 --- diff --git a/ChangeLog b/ChangeLog index 5d2dd4c4..d005b214 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,8 @@ Changes in 2.0.3-alpha: o Do not detect whether we have monotonic clock support every time a new event base is created: instead do it only once. Patch taken from Chromium. o Do not allocate the maximum event queue for the epoll backend at startup. Instead, start out accepting 32 events at a time, and double the queue's size when it seems that the OS is generating events faster than we're requesting them. Saves up to 374K per epoll-based event_base. Resolves bug 2839240. o Treat an event with a negative fd as valid but untriggerable by Libevent. This is useful for applications that want to manually activate events. - + o Fix compilation on Android, which forgot to define fd_mask in its sys/select.h + Changes in 2.0.2-alpha: o Add a new flag to bufferevents to make all callbacks automatically deferred. diff --git a/configure.in b/configure.in index 8b7ed008..977646dd 100644 --- a/configure.in +++ b/configure.in @@ -352,6 +352,14 @@ AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t], , , #include #endif]) +AC_CHECK_TYPES([fd_mask], , , +[#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SELECT_H +#include +#endif]) + AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) diff --git a/select.c b/select.c index 98d5749f..ace8037c 100644 --- a/select.c +++ b/select.c @@ -57,6 +57,13 @@ #define howmany(x, y) (((x)+((y)-1))/(y)) #endif +#ifndef _EVENT_HAVE_FD_MASK +/* This type is mandatory, but Android doesn't define it. */ +#undef NFDBITS +#define NFDBITS (sizeof(long)*8) +typedef unsigned long fd_mask; +#endif + struct selectop { int event_fds; /* Highest fd in fd set */ int event_fdsz;