aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Wiley <wiley@google.com>2016-02-25 13:21:35 -0800
committerChristopher Wiley <wiley@google.com>2016-02-25 13:34:44 -0800
commit98da59020d0d01409ff40a0aa362403258d4af90 (patch)
tree82defd595e5d3f1cc8c169532c9c620233ac4aec
parent70c40a85a3fa6a56a0587f855e3f9bc15667b587 (diff)
downloadlibevent-98da59020d0d01409ff40a0aa362403258d4af90.tar.gz
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
-rw-r--r--Android.mk3
-rw-r--r--include/event2/event-config-darwin.h15
-rw-r--r--include/event2/event-config-linux.h14
3 files changed, 25 insertions, 7 deletions
diff --git a/Android.mk b/Android.mk
index 8eaf4e5..72eca2b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -55,7 +55,8 @@ libevent_cflags := \
-O3 \
-Wno-implicit-function-declaration \
-Wno-strict-aliasing \
- -Wno-unused-parameter
+ -Wno-unused-parameter \
+ -Werror
include $(CLEAR_VARS)
LOCAL_MODULE := libevent
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