Forward-port: fix android compilation

svn:r1435
This commit is contained in:
Nick Mathewson 2009-09-23 23:51:26 +00:00
parent 2622e5ace2
commit 18fe400805
3 changed files with 17 additions and 1 deletions

View File

@ -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 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 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 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: Changes in 2.0.2-alpha:
o Add a new flag to bufferevents to make all callbacks automatically deferred. o Add a new flag to bufferevents to make all callbacks automatically deferred.

View File

@ -352,6 +352,14 @@ AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t], , ,
#include <sys/types.h> #include <sys/types.h>
#endif]) #endif])
AC_CHECK_TYPES([fd_mask], , ,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SELECT_H
#include <select.h>
#endif])
AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(int)

View File

@ -57,6 +57,13 @@
#define howmany(x, y) (((x)+((y)-1))/(y)) #define howmany(x, y) (((x)+((y)-1))/(y))
#endif #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 { struct selectop {
int event_fds; /* Highest fd in fd set */ int event_fds; /* Highest fd in fd set */
int event_fdsz; int event_fdsz;