projects/aports·blob master · refs

20 lines · 850 B

1Patch-Source: https://github.com/krakjoe/pcov/pull/133
2PHP 8.6 removed the INI_STR()/INI_INT()/INI_BOOL() macros and made
3zend_ini_string() return const char*; provide compatible replacements.
4--- a/pcov.c 2026-07-01 07:13:32.108284413 +0200
5+++ b/pcov.c 2026-07-01 07:13:32.148079972 +0200
6@@ -39,6 +39,14 @@
7
8 #include "php_pcov.h"
9
10+/* PHP 8.6 removed the INI_STR()/INI_INT()/INI_BOOL() accessor macros and
11+ * zend_ini_string() now returns const char*. Restore them for this build. */
12+#if PHP_VERSION_ID >= 80600
13+# define INI_STR(name) ((char*) zend_ini_string((name), strlen(name), 0))
14+# define INI_INT(name) ((zend_long) zend_ini_long((name), strlen(name), 0))
15+# define INI_BOOL(name) ((bool) zend_ini_long((name), strlen(name), 0))
16+#endif
17+
18 #define PCOV_FILTER_ALL 0
19 #define PCOV_FILTER_INCLUDE 1
20 #define PCOV_FILTER_EXCLUDE 2