diff options
author | Christopher Wiley <wiley@google.com> | 2016-02-25 13:21:35 -0800 |
---|---|---|
committer | Christopher Wiley <wiley@google.com> | 2016-02-25 13:34:44 -0800 |
commit | 98da59020d0d01409ff40a0aa362403258d4af90 (patch) | |
tree | 82defd595e5d3f1cc8c169532c9c620233ac4aec /include | |
parent | 70c40a85a3fa6a56a0587f855e3f9bc15667b587 (diff) | |
download | libevent-98da59020d0d01409ff40a0aa362403258d4af90.tar.gz |
Fix build warnings in libeventandroid-wear-n-preview-3android-wear-n-preview-1android-n-preview-4android-n-preview-3android-n-preview-2android-n-preview-1
Fix warnings related to EV_SSIZE_MAX by correctly defining
_EVENT_SIZEOF_SIZE_T, which is the basis for EV_SSIZE_MAX.
This apparently was only broken for 32 bit host builds of libevent.
Apply -Werror to make future warnings fatal.
Bug: 27075012
Test: mmma -j29 external/libevent for aosp_arm-eng and aosp_x86_64-eng
speculatively fixed darwin warnings.
Change-Id: I09f804ccefdab15bb77f82b81cb0cb4132b751c8
Diffstat (limited to 'include')
-rw-r--r-- | include/event2/event-config-darwin.h | 15 | ||||
-rw-r--r-- | include/event2/event-config-linux.h | 14 |
2 files changed, 23 insertions, 6 deletions
diff --git a/include/event2/event-config-darwin.h b/include/event2/event-config-darwin.h index 06ecd0f..4d4e239 100644 --- a/include/event2/event-config-darwin.h +++ b/include/event2/event-config-darwin.h @@ -10,6 +10,18 @@ #ifndef _EVENT2_EVENT_CONFIG_H_ #define _EVENT2_EVENT_CONFIG_H_ + +#include <stdint.h> + +/* The size of `size_t', as computed by sizeof. */ +#if SIZE_MAX == UINT64_MAX +# define _EVENT_SIZEOF_SIZE_T 8 +#elif SIZE_MAX == UINT32_MAX +# define _EVENT_SIZEOF_SIZE_T 4 +#else +# error "No way to infer sizeof size_t" +#endif + /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ @@ -415,9 +427,6 @@ /* The size of `short', as computed by sizeof. */ #define _EVENT_SIZEOF_SHORT 2 -/* The size of `size_t', as computed by sizeof. */ -#define _EVENT_SIZEOF_SIZE_T 8 - /* The size of `void *', as computed by sizeof. */ #define _EVENT_SIZEOF_VOID_P 8 diff --git a/include/event2/event-config-linux.h b/include/event2/event-config-linux.h index 60a0855..5a906df 100644 --- a/include/event2/event-config-linux.h +++ b/include/event2/event-config-linux.h @@ -11,6 +11,17 @@ #ifndef _EVENT2_EVENT_CONFIG_H_ #define _EVENT2_EVENT_CONFIG_H_ +#include <stdint.h> + +/* The size of `size_t', as computed by sizeof. */ +#if SIZE_MAX == UINT64_MAX +# define _EVENT_SIZEOF_SIZE_T 8 +#elif SIZE_MAX == UINT32_MAX +# define _EVENT_SIZEOF_SIZE_T 4 +#else +# error "No way to infer sizeof size_t" +#endif + /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ @@ -416,9 +427,6 @@ /* The size of `short', as computed by sizeof. */ #define _EVENT_SIZEOF_SHORT 2 -/* The size of `size_t', as computed by sizeof. */ -#define _EVENT_SIZEOF_SIZE_T 8 - /* The size of `void *', as computed by sizeof. */ #define _EVENT_SIZEOF_VOID_P 8 |