AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
-AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t], , ,
+AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t, uintptr_t], , ,
[#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif defined(HAVE_INTTYPES_H)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(void *)
AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo], , ,
[#define _GNU_SOURCE
/* Integer type definitions for types that are supposed to be defined in the
* C99-specified stdint.h. Shamefully, some platforms do not include
* stdint.h, so we need to replace it. (If you are on a platform like this,
- * your C headers are now 10 years out of date. You should bug them to do
- * something about this.)
+ * your C headers are now over 10 years out of date. You should bug them to
+ * do something about this.)
*
* We define:
* ev_uint64_t, ev_uint32_t, ev_uint16_t, ev_uint8_t -- unsigned integer
* types of exactly 64, 32, 16, and 8 bits respectively.
* ev_int64_t, ev_int32_t, ev_int16_t, ev_int8_t -- signed integer
* types of exactly 64, 32, 16, and 8 bits respectively.
+ * ev_uintptr_t, ev_intptr_t -- unsigned/signed integers large enough
+ * to hold a pointer without loss of bits.
*/
#ifdef _EVENT_HAVE_UINT64_T
#define ev_uint64_t uint64_t
#define ev_uint8_t unsigned char
#endif
+#ifdef _EVENT_HAVE_UINTPTR_T
+#define ev_uintptr_t uintptr_t
+#define ev_intptr_t intptr_t
+#elif _EVENT_SIZEOF_VOID_P <= 4
+#define ev_uintptr_t ev_uint32_t
+#define ev_uintptr_t ev_int32_t
+#elif _EVENT_SIZEOF_VOID_P <= 8
+#define ev_uintptr_t ev_uint64_t
+#define ev_uintptr_t ev_int64_t
+#else
+#error "No way to define ev_uintptr_t"
+#endif
+
#ifdef _EVENT_ssize_t
#define ev_ssize_t _EVENT_ssize_t
#else