Skip to content

Commit b6bab18

Browse files
ndosschejmarble
authored andcommitted
Fix phpGH-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 d363639 commit b6bab18

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
@@ -34,6 +34,10 @@ PHP NEWS
3434
buffer/parser handling. (ndossche)
3535
>>>>>>> 6054a900ff (libxml: Fix some deprecations regarding input buffer/parser handling)
3636

37+
- MbString:
38+
. Fixed bug GH-20491 (SLES15 compile error with mbstring oniguruma).
39+
(ndossche)
40+
3741
- Opcache:
3842
. Fixed bug GH-20329 (opcache.file_cache broken with full interned string
3943
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)