From: Michael Wallner Date: Wed, 17 May 2006 08:36:04 +0000 (+0000) Subject: - fix build with php-5.2 X-Git-Tag: RELEASE_1_0_0~31 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=988f1d1ea97c689b9b7d288b0efe5b93dd0eb04a;p=m6w6%2Fext-http - fix build with php-5.2 --- diff --git a/http_exception_object.c b/http_exception_object.c index 422f6ce..06d464e 100644 --- a/http_exception_object.c +++ b/http_exception_object.c @@ -35,7 +35,7 @@ zend_class_entry *HTTP_EX_CE(querystring); PHP_MINIT_FUNCTION(http_exception_object) { - HTTP_REGISTER_EXCEPTION(HttpException, http_exception_object_ce, zend_exception_get_default()); + HTTP_REGISTER_EXCEPTION(HttpException, http_exception_object_ce, ZEND_EXCEPTION_GET_DEFAULT()); HTTP_REGISTER_EXCEPTION(HttpRuntimeException, HTTP_EX_CE(runtime), HTTP_EX_DEF_CE); HTTP_REGISTER_EXCEPTION(HttpInvalidParamException, HTTP_EX_CE(invalid_param), HTTP_EX_DEF_CE); HTTP_REGISTER_EXCEPTION(HttpHeaderException, HTTP_EX_CE(header), HTTP_EX_DEF_CE); diff --git a/http_request_pool_api.c b/http_request_pool_api.c index cf84218..e9473e3 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -288,11 +288,11 @@ static void move_backtrace_args(zval *from, zval *to TSRMLS_DC) { zval **args, **trace_0, *old_trace_0, *trace = NULL; - if ((trace = zend_read_property(zend_exception_get_default(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) { + if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) { if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { old_trace_0 = *trace_0; if (SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void *) &args)) { - if ((trace = zend_read_property(zend_exception_get_default(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) { + if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) { if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { ZVAL_ADDREF(*args); add_assoc_zval(*trace_0, "args", *args); diff --git a/php_http_std_defs.h b/php_http_std_defs.h index 9f22bcf..154f778 100644 --- a/php_http_std_defs.h +++ b/php_http_std_defs.h @@ -306,6 +306,12 @@ typedef int STATUS; # define end_error_handling() #endif +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION > 5 +# define ZEND_EXCEPTION_GET_DEFAULT() zend_exception_get_default(TSRMLS_C) +#else +# define ZEND_EXCEPTION_GET_DEFAULT() zend_exception_get_default() +#endif + #ifndef E_THROW # define E_THROW 0 #endif