- fix builds and tests without libcurl linked in
[m6w6/ext-http] / php_http_std_defs.h
index f0e862e04c5814255e88220673360de67ac1e625..dc20aa1e7caa4964508b2f39b8651e92a8b2cf21 100644 (file)
@@ -54,7 +54,6 @@ typedef int STATUS;
        return_value->is_ref = 1; \
        return_value->type = IS_OBJECT; \
        return_value->value.obj = (ov); \
-       zval_add_ref(&return_value); \
        zend_objects_store_add_ref(return_value TSRMLS_CC)
 #define RETURN_OBJVAL(ov) \
        RETVAL_OBJVAL(ov); \
@@ -334,9 +333,15 @@ typedef int STATUS;
 #      define E_THROW 0
 #endif
 #define HE_THROW       E_THROW
-#define HE_NOTICE      (HTTP_G(only_exceptions) ? E_THROW : E_NOTICE)
-#define HE_WARNING     (HTTP_G(only_exceptions) ? E_THROW : E_WARNING)
-#define HE_ERROR       (HTTP_G(only_exceptions) ? E_THROW : E_ERROR)
+#ifdef ZEND_ENGINE_2
+#      define HE_NOTICE        (HTTP_G(only_exceptions) ? E_THROW : E_NOTICE)
+#      define HE_WARNING       (HTTP_G(only_exceptions) ? E_THROW : E_WARNING)
+#      define HE_ERROR         (HTTP_G(only_exceptions) ? E_THROW : E_ERROR)
+#else
+#      define HE_NOTICE        E_NOTICE
+#      define HE_WARNING       E_WARNING
+#      define HE_ERROR         E_ERROR
+#endif
 
 #define HTTP_E_RUNTIME                         1L
 #define HTTP_E_INVALID_PARAM           2L