fix headers again, avoid header clashing including event2/*.h
[m6w6/ext-http] / php_http_client_curl.c
index fbb950ac276eb4a059a4494746601dea236c3fa1..01e626d7385f7462868ee18e23fb9eeacd1d8ab4 100644 (file)
 #if PHP_HTTP_HAVE_CURL
 
 #if PHP_HTTP_HAVE_EVENT
-#      include <event.h>
 #      if !PHP_HTTP_HAVE_EVENT2 && /* just be really sure */ !(LIBEVENT_VERSION_NUMBER >= 0x02000000)
+#          include <event.h>
 #              define event_base_new event_init
 #              define event_assign(e, b, s, a, cb, d) do {\
                        event_set(e, s, a, cb, d); \
                        event_base_set(b, e); \
                } while(0)
-#      endif
+#   else
+#       if PHP_HTTP_HAVE_EVENT2
+#              include <event2/event.h>
+#              include <event2/event_struct.h>
+#       else
+#           error "libevent presence is unknown"
+#       endif
+#   endif
 #      ifndef DBG_EVENTS
 #              define DBG_EVENTS 0
 #      endif
@@ -1089,7 +1096,7 @@ static void php_http_curle_options_init(php_http_options_t *registry TSRMLS_DC)
        /* useragent */
        if ((opt = php_http_option_register(registry, ZEND_STRL("useragent"), CURLOPT_USERAGENT, IS_STRING))) {
                /* don't check strlen, to allow sending no useragent at all */
-               ZVAL_STRING(&opt->defval, "PECL::HTTP/" PHP_HTTP_EXT_VERSION " (PHP/" PHP_VERSION ")", 0);
+               ZVAL_STRING(&opt->defval, "PECL::HTTP/" PHP_PECL_HTTP_VERSION " (PHP/" PHP_VERSION ")", 0);
        }
 
        /* resume */