Skip to content

intl extension, build fix for icu >= 71.x release. #8930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ext/intl/converter/converter.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,18 @@ static zend_object *php_converter_clone_object(zend_object *object) {

intl_errors_reset(&oldobj->error);

#if U_ICU_VERSION_MAJOR_NUM > 70
objval->src = ucnv_clone(oldobj->src, &error);
#else
objval->src = ucnv_safeClone(oldobj->src, NULL, NULL, &error);
#endif
if (U_SUCCESS(error)) {
error = U_ZERO_ERROR;
#if U_ICU_VERSION_MAJOR_NUM > 70
objval->dest = ucnv_clone(oldobj->dest, &error);
#else
objval->dest = ucnv_safeClone(oldobj->dest, NULL, NULL, &error);
#endif
}
if (U_FAILURE(error)) {
zend_string *err_msg;
Expand Down
8 changes: 5 additions & 3 deletions ext/intl/grapheme/grapheme_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,6 @@ zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *need
/* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */
UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status )
{
int32_t buffer_size;

UBreakIterator *global_break_iterator = INTL_G( grapheme_iterator );

if ( NULL == global_break_iterator ) {
Expand All @@ -387,8 +385,12 @@ UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *stat
INTL_G(grapheme_iterator) = global_break_iterator;
}

buffer_size = U_BRK_SAFECLONE_BUFFERSIZE;
#if U_ICU_VERSION_MAJOR_NUM >= 69
return ubrk_clone(global_break_iterator, status);
#else
int32_t buffer_size = U_BRK_SAFECLONE_BUFFERSIZE;

return ubrk_safeClone(global_break_iterator, stack_buffer, &buffer_size, status);
#endif
}
/* }}} */