From d1cbd173944bbba55b92de019b01760746a67f78 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 12 Jul 2023 09:34:53 +0200 Subject: build out of sources tree add upstream patch for PHP 8.3 --- ...nction-removed-in-PHP-8.3-use-add_functio.patch | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 0001-fast_add_function-removed-in-PHP-8.3-use-add_functio.patch (limited to '0001-fast_add_function-removed-in-PHP-8.3-use-add_functio.patch') diff --git a/0001-fast_add_function-removed-in-PHP-8.3-use-add_functio.patch b/0001-fast_add_function-removed-in-PHP-8.3-use-add_functio.patch new file mode 100644 index 0000000..56f2bd9 --- /dev/null +++ b/0001-fast_add_function-removed-in-PHP-8.3-use-add_functio.patch @@ -0,0 +1,44 @@ +From d6ad43ee713b4b57111462309358c97e0b43cab3 Mon Sep 17 00:00:00 2001 +From: Jan Ehrhardt +Date: Sun, 18 Jun 2023 01:48:54 +0200 +Subject: [PATCH] fast_add_function removed in PHP 8.3, use add_function + +--- + src/common.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/src/common.h b/src/common.h +index 5ff8cd4..509a6bb 100644 +--- a/src/common.h ++++ b/src/common.h +@@ -84,6 +84,7 @@ do { \ + /** + * Adds the given zval "val" to "sum". + */ ++#if PHP_MAJOR_VERSION < 8 || PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION < 3 + #define DS_ADD_TO_SUM(val, sum) \ + do { \ + if (Z_TYPE_P(val) == IS_LONG || Z_TYPE_P(val) == IS_DOUBLE) { \ +@@ -95,6 +96,19 @@ do { \ + fast_add_function(sum, sum, &_num); \ + } \ + } while (0) ++#else ++#define DS_ADD_TO_SUM(val, sum) \ ++do { \ ++ if (Z_TYPE_P(val) == IS_LONG || Z_TYPE_P(val) == IS_DOUBLE) { \ ++ add_function(sum, sum, val); \ ++ } else { \ ++ zval _num; \ ++ ZVAL_COPY(&_num, val); \ ++ convert_scalar_to_number(&_num); \ ++ add_function(sum, sum, &_num); \ ++ } \ ++} while (0) ++#endif + + /** + * Used to replace a buffer with a new one. +-- +2.41.0 + -- cgit