]> granicus.if.org Git - libevent/commitdiff
Forward-port: fix android compilation
authorNick Mathewson <nickm@torproject.org>
Wed, 23 Sep 2009 23:51:26 +0000 (23:51 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 23 Sep 2009 23:51:26 +0000 (23:51 +0000)
svn:r1435

ChangeLog
configure.in
select.c

index 5d2dd4c4dba6adada412fa3a16733db0c46a8059..d005b2141bb7d05ab2ac0b8371c85867f5527d48 100644 (file)
--- 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.
index 8b7ed00868d44cbe62d27c5b7ca00efd65160d16..977646dd5a014cab62028e7895ad43d9c1d39c58 100644 (file)
@@ -352,6 +352,14 @@ AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t], , ,
 #include <sys/types.h>
 #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)
 AC_CHECK_SIZEOF(int)
index 98d5749f10980f8d2f85c3f466b9dddb8813506d..ace8037c80dc152e73c6eaa841a58da34f00701f 100644 (file)
--- a/select.c
+++ b/select.c
 #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;