convert_to_explicit_type has been removed upstream
authorMichael Wallner <mike@php.net>
Wed, 10 Mar 2021 09:16:30 +0000 (10:16 +0100)
committerMichael Wallner <mike@php.net>
Wed, 10 Mar 2021 09:16:30 +0000 (10:16 +0100)
src/php_http_misc.h

index 481fb8c5b71b88a04c8258ff00750196864a6efa..19eb75cb894276f3021452b330e413dbea2e7c61 100644 (file)
@@ -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) {