X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_http_misc.h;h=c45ab1595aeee65c4e0dee3a16a2be9924310d39;hb=refs%2Fheads%2Fmaster;hp=481fb8c5b71b88a04c8258ff00750196864a6efa;hpb=f1b9163c7c8f71c833b21974975a15444cd5e24a;p=m6w6%2Fext-http diff --git a/src/php_http_misc.h b/src/php_http_misc.h index 481fb8c..c45ab15 100644 --- a/src/php_http_misc.h +++ b/src/php_http_misc.h @@ -106,12 +106,48 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i # define php_http_mem_stream_open(type, zstr) php_stream_memory_open((type), (zstr)) #else # define php_http_mem_stream_open(type, zstr) php_stream_memory_open((type), (zstr)->val, (zstr)->len) +# define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) +# define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) #endif #define HT_IS_RECURSIVE(ht) GC_IS_RECURSIVE(ht) #define HT_PROTECT_RECURSION(ht) GC_PROTECT_RECURSION(ht) #define HT_UNPROTECT_RECURSION(ht) GC_UNPROTECT_RECURSION(ht) +#ifndef convert_to_explicit_type +# define convert_to_explicit_type(pzv, type) \ + do { \ + switch (type) { \ + case IS_NULL: \ + convert_to_null(pzv); \ + break; \ + case IS_LONG: \ + convert_to_long(pzv); \ + break; \ + case IS_DOUBLE: \ + convert_to_double(pzv); \ + break; \ + case _IS_BOOL: \ + convert_to_boolean(pzv); \ + break; \ + case IS_ARRAY: \ + convert_to_array(pzv); \ + break; \ + case IS_OBJECT: \ + convert_to_object(pzv); \ + break; \ + case IS_STRING: \ + convert_to_string(pzv); \ + break; \ + default: \ + assert(0); \ + break; \ + } \ + } while (0); + +#endif static inline void *PHP_HTTP_OBJ(zend_object *zo, zval *zv) { if (!zo) {