Permalink
Browse files

--compiler_warnings;

Unfortunately does the libevent2 version of evhttp.h generate a compiler warning
which is now avoided by using event2/http.h instead.
  • Loading branch information...
1 parent f383e38 commit 2dbc0df653a9955a3255ec25dd6d47513c86b87c @d1saster committed Jan 3, 2012
@@ -77,6 +77,10 @@ if (NOT HAVE_CUSTOM_LIBEVENT)
unset(LIBEVENT_LIB CACHE)
unset(LibEvent_FOUND CACHE)
message(FATAL_ERROR "Custom libevent is required with HipHop patches")
+else ()
+ if (EXISTS "${LIBEVENT_INCLUDE_DIR}/event2/http.h")
+ add_definitions(-DHPHP_HAVE_LIBEVENT2)
+ endif()
endif ()
set(CMAKE_REQUIRED_LIBRARIES)
@@ -18,7 +18,14 @@
#define __HTTP_SERVER_LIB_EVENT_TRANSPORT_H__
#include <runtime/base/server/transport.h>
+#ifdef HPHP_HAVE_LIBEVENT2
+#include <event.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/http_compat.h>
+#else
#include <evhttp.h>
+#endif
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
@@ -20,7 +20,14 @@
#include <util/base.h>
#include <util/async_func.h>
#include <util/lock.h>
+#ifdef HPHP_HAVE_LIBEVENT2
+#include <event.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/http_compat.h>
+#else
#include <evhttp.h>
+#endif
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
@@ -19,7 +19,14 @@
#define __EXT_IMAGESPRITE_INCLUDE_H__
#include <runtime/base/base_includes.h>
+#ifdef HPHP_HAVE_LIBEVENT2
+#include <event.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/http_compat.h>
+#else
#include <evhttp.h>
+#endif
#include <gd.h>
namespace HPHP {

0 comments on commit 2dbc0df

Please sign in to comment.