Skip to content

Commit a1912e3

Browse files
committed
Fix GH-20491: SLES15 compile error with mbstring oniguruma
The issue is specific to SLES15. Arguably this should be reported to them as it seems to me they meddled with the oniguruma source code. The definition in oniguruma.h on that platform looks like this (same as upstream): ```c ONIG_EXTERN int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...)); ``` Where `PV_` is defined as (differs): ```c #ifndef PV_ #ifdef HAVE_STDARG_PROTOTYPES # define PV_(args) args #else # define PV_(args) () #endif #endif ``` So that means that `HAVE_STDARG_PROTOTYPES` is unset. This can be set if we define `HAVE_STDARG_H`, which we can do because PHP requires at least C99 in which the header is always available. We could also use an autoconf check, but this isn't really necessary as it will always succeed.
1 parent 8c24077 commit a1912e3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ PHP NEWS
2626
. Fix some deprecations on newer libxml versions regarding input
2727
buffer/parser handling. (ndossche)
2828

29+
- MbString:
30+
. Fixed bug GH-20491 (SLES15 compile error with mbstring oniguruma).
31+
(ndossche)
32+
2933
- Opcache:
3034
. Fixed bug GH-20329 (opcache.file_cache broken with full interned string
3135
buffer). (Arnaud)

ext/mbstring/php_onig_compat.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
#define regex_t php_mb_regex_t
66
#define re_registers php_mb_re_registers
77

8+
/* Required for some distros that conditionally override PV_.
9+
* As we're in C99 this header is always available. */
10+
#ifndef HAVE_STDARG_H
11+
# define HAVE_STDARG_H
12+
#endif
13+
814
#endif /* _PHP_ONIG_COMPAT_H */

0 commit comments

Comments
 (0)