Bug 1318914 - Fix --with-system-libevent build against libevent 2.1. r?billm draft
authorMike Hommey <mh+mozilla@glandium.org>
Sun, 20 Nov 2016 17:51:17 +0900
changeset 441635 983a3ee225c8945d5d437b990582cd89b028ea43
parent 441455 f09e137ead39230eaa94f47988ccce2cfcda4195
child 442275 bb154cbfb0a8076ff7617e55045a49df698ab9f1
child 442276 070a7c1c8e8ca55511d82316ff21cd17c4243690
push id36474
push userbmo:mh+mozilla@glandium.org
push dateSun, 20 Nov 2016 08:52:33 +0000
reviewersbillm
bugs1318914
milestone53.0a1
Bug 1318914 - Fix --with-system-libevent build against libevent 2.1. r?billm
ipc/chromium/src/base/message_pump_libevent.cc
--- a/ipc/chromium/src/base/message_pump_libevent.cc
+++ b/ipc/chromium/src/base/message_pump_libevent.cc
@@ -17,19 +17,27 @@
 #include "base/scoped_nsautorelease_pool.h"
 #include "base/time.h"
 #include "nsDependentSubstring.h"
 #include "event.h"
 #include "mozilla/UniquePtr.h"
 
 // This macro checks that the _EVENT_SIZEOF_* constants defined in
 // ipc/chromiume/src/third_party/<platform>/event2/event-config.h are correct.
+#if defined(_EVENT_SIZEOF_SHORT)
 #define CHECK_EVENT_SIZEOF(TYPE, type) \
     static_assert(_EVENT_SIZEOF_##TYPE == sizeof(type), \
     "bad _EVENT_SIZEOF_"#TYPE);
+#elif defined(EVENT__SIZEOF_SHORT)
+#define CHECK_EVENT_SIZEOF(TYPE, type) \
+    static_assert(EVENT__SIZEOF_##TYPE == sizeof(type), \
+    "bad EVENT__SIZEOF_"#TYPE);
+#else
+#error Cannot find libevent type sizes
+#endif
 
 CHECK_EVENT_SIZEOF(LONG,      long);
 CHECK_EVENT_SIZEOF(LONG_LONG, long long);
 CHECK_EVENT_SIZEOF(PTHREAD_T, pthread_t);
 CHECK_EVENT_SIZEOF(SHORT,     short);
 CHECK_EVENT_SIZEOF(SIZE_T,    size_t);
 CHECK_EVENT_SIZEOF(VOID_P,    void*);