ext/intl: fix build with older ICU - #23539
Conversation
|
I know that Debian Buster is long dead, but this is a simple change and will help with the packaging for older releases. |
b0d735c to
4374f98
Compare
Are you sure it s not ICU 65 (NumberFormat::clone() as virtual) ? |
devnexen
left a comment
There was a problem hiding this comment.
lgtm static_cast is safe to use in this case.
Debian Buster had 63.1-6+deb10u4 and Debian Bullseye had 67.1-7, so it some version of ICU between these two versions. But reading the changelog, I think you might be right: https://icu.unicode.org/download/65 I've amended the commit and the comment above and force pushed. |
Covariant return types for clone() were only introduced in ICU 65; before that NumberFormat::clone() returns Format*, so cast the result explicitly in NumberFormatter_object_clone(). <unicode/numberrangeformatter.h> is a C++-only header, and older ICU does not wrap it in U_SHOW_CPLUSPLUS_API, so including it from php_intl.c breaks the C compile. Move it into the __cplusplus branch, next to the using declaration that needs it.
4374f98 to
7cee3e6
Compare
|
Thanks ! |
Covariant return types for clone() were only introduced in ICU 65; before that NumberFormat::clone() returns Format*, so cast the result explicitly in NumberFormatter_object_clone().
<unicode/numberrangeformatter.h> is a C++-only header, and older ICU does not wrap it in U_SHOW_CPLUSPLUS_API, so including it from php_intl.c breaks the C compile. Move it into the __cplusplus branch, next to the using declaration that needs it.