diff --git a/configure.in b/configure.in index 5d889efb..a997de6f 100644 --- a/configure.in +++ b/configure.in @@ -172,6 +172,8 @@ fi AC_SUBST(EV_LIB_WS32) AC_SUBST(EV_LIB_GDI) +AC_SYS_LARGEFILE + LIBEVENT_OPENSSL dnl Checks for header files. @@ -542,6 +544,7 @@ AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(off_t) AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo, struct sockaddr_storage], , , [#define _GNU_SOURCE diff --git a/evconfig-private.h.in b/evconfig-private.h.in index cffdf531..254ae509 100644 --- a/evconfig-private.h.in +++ b/evconfig-private.h.in @@ -24,6 +24,11 @@ # undef __EXTENSIONS__ #endif +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + /* Define to 1 if on MINIX. */ #ifndef _MINIX #undef _MINIX diff --git a/include/event2/util.h b/include/event2/util.h index c71fdcf5..2494b384 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -193,8 +193,21 @@ extern "C" { #define ev_ssize_t ssize_t #endif +/* Note that we define ev_off_t based on the compile-time size of off_t that + * we used to build Libevent, and not based on the current size of off_t. + * (For example, we don't define ev_off_t to off_t.). We do this because + * some systems let you build your software with different off_t sizes + * at runtime, and so putting in any dependency on off_t would risk API + * mismatch. + */ #ifdef _WIN32 #define ev_off_t ev_int64_t +#elif _EVENT_SIZEOF_OFF_T == 8 +#define ev_off_t ev_int64_t +#elif _EVENT_SIZEOF_OFF_T == 4 +#define ev_off_t ev_int32_t +#elif defined(_EVENT_IN_DOXYGEN) +#define ev_off_t ... #else #define ev_off_t off_t #endif