| 1 | Patch-Source: https://github.com/php/pecl-php-uploadprogress/pull/19
|
| 2 | From 1784fabd6543c6d563c4658714a5536d901e2f04 Mon Sep 17 00:00:00 2001
|
| 3 | From: Andy Postnikov <[email protected]>
|
| 4 | Date: Wed, 1 Jul 2026 02:48:21 +0200
|
| 5 | Subject: [PATCH] Fix build against PHP 8.6 (INI_STR/INI_BOOL macros removed)
|
| 6 |
|
| 7 | PHP 8.6 removed the legacy uppercase INI_STR() and INI_BOOL() macros in
|
| 8 | favour of the lowercase zend_ini_string()/zend_ini_long() helpers, which
|
| 9 | have been available since PHP 7. Building against 8.6 therefore fails with
|
| 10 | implicit-function-declaration errors.
|
| 11 |
|
| 12 | Add guarded fallback definitions so the extension keeps compiling on both
|
| 13 | older and newer PHP versions without touching the call sites.
|
| 14 |
|
| 15 | Ref: https://github.com/php/php-src/commit/df8ce6ddbd713d7e9163dd60d19648e2e4a8bb80
|
| 16 |
|
| 17 | Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
| 18 | ---
|
| 19 | uploadprogress.c | 10 ++++++++++
|
| 20 | 1 file changed, 10 insertions(+)
|
| 21 |
|
| 22 | diff --git a/uploadprogress.c b/uploadprogress.c
|
| 23 | index 57f6f0b..d266b9a 100644
|
| 24 | |
| 25 | |
| 26 | @@ -29,6 +29,16 @@
|
| 27 | #define TMPDIR "/tmp"
|
| 28 | #endif
|
| 29 |
|
| 30 | +/* PHP 8.6 removed the legacy INI_STR()/INI_BOOL() macros in favour of
|
| 31 | + * zend_ini_string()/zend_ini_long(). Provide fallbacks so the extension
|
| 32 | + * keeps building on both older and newer PHP versions. */
|
| 33 | +#ifndef INI_STR
|
| 34 | +# define INI_STR(name) ((char *) zend_ini_string((name), strlen(name), 0))
|
| 35 | +#endif
|
| 36 | +#ifndef INI_BOOL
|
| 37 | +# define INI_BOOL(name) ((bool) zend_ini_long((name), strlen(name), 0))
|
| 38 | +#endif
|
| 39 | +
|
| 40 | /* {{{ argument information */
|
| 41 | #if PHP_VERSION_ID < 80000
|
| 42 | #include "uploadprogress_legacy_arginfo.h"
|