From: Michael Wallner Date: Wed, 10 Mar 2021 09:16:30 +0000 (+0100) Subject: convert_to_explicit_type has been removed upstream X-Git-Tag: v4.1.0~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4776c4e3a82a34f21cd5c4f5cc246621e5f498f3;p=m6w6%2Fext-http convert_to_explicit_type has been removed upstream --- diff --git a/src/php_http_misc.h b/src/php_http_misc.h index 481fb8c..19eb75c 100644 --- a/src/php_http_misc.h +++ b/src/php_http_misc.h @@ -112,6 +112,38 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i #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) {