X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_std_defs.h;h=58531b8ca4d6c2f590ae19edb1b570559bcb90a9;hp=00246859584ce7a7228f7010ed7613c57d770240;hb=020d5b055921392c0dfb25043962a40867d8b033;hpb=1ad1914243fce5fb0416a82258ec25e966f802b7 diff --git a/php_http_std_defs.h b/php_http_std_defs.h index 0024685..58531b8 100644 --- a/php_http_std_defs.h +++ b/php_http_std_defs.h @@ -46,10 +46,7 @@ typedef int STATUS; #define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v)) /* return object(values) */ #define RETVAL_OBJECT(o) \ - return_value->is_ref = 1; \ - return_value->type = IS_OBJECT; \ - return_value->value.obj = (o)->value.obj; \ - zval_add_ref(&return_value) + RETVAL_OBJVAL((o)->value.obj) #define RETURN_OBJECT(o) \ RETVAL_OBJECT(o); \ return @@ -57,6 +54,7 @@ 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); \ @@ -246,6 +244,16 @@ typedef int STATUS; #define HTTP_E_URL 7L #define HTTP_E_MSG 8L +#ifdef ZEND_ENGINE_2 +# define HTTP_BEGIN_ARGS_EX(class, method, ret_ref, req_args) static ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 0, ret_ref, req_args) +# define HTTP_BEGIN_ARGS_AR(class, method, ret_ref, req_args) static ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 1, ret_ref, req_args) +# define HTTP_END_ARGS } +# define HTTP_EMPTY_ARGS_EX(class, method, ret_ref) HTTP_BEGIN_ARGS_EX(class, method, ret_ref, 0) HTTP_END_ARGS +# define HTTP_ARGS(class, method) args_for_ ##class## _ ##method +# define HTTP_ARG_VAL(name, pass_ref) ZEND_ARG_INFO(pass_ref, name) +# define HTTP_ARG_OBJ(class, name, allow_null) ZEND_ARG_OBJ_INFO(1, name, class, allow_null) +#endif + #ifdef HTTP_HAVE_CURL # ifdef ZEND_ENGINE_2 # define HTTP_DECLARE_ARG_PASS_INFO() \ @@ -289,6 +297,24 @@ typedef int STATUS; #endif /* HTTP_HAVE_CURL */ +#ifndef TSRMLS_FETCH_FROM_CTX +# ifdef ZTS +# define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx +# else +# define TSRMLS_FETCH_FROM_CTX(ctx) +# endif +#endif + +#ifndef TSRMLS_SET_CTX +# ifdef ZTS +# define TSRMLS_SET_CTX(ctx) (void ***) ctx = tsrm_ls +# else +# define TSRMLS_SET_CTX(ctx) +# endif +#endif + + + #endif /* PHP_HTTP_STD_DEFS_H */ /*