diff options
author | Anatol Belski <ab@php.net> | 2018-04-05 17:22:44 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-04-05 17:22:44 +0200 |
commit | 9a8e7b571896f39f83cb000fdb7c466b6d328d52 (patch) | |
tree | c8e79082a612e9347dfab6b36ddbcbf61174fcfb /ext/intl/grapheme/grapheme_string.c | |
parent | 863aeddc35df3a31f71971ba9f260d1b7b5791c8 (diff) | |
download | php-git-9a8e7b571896f39f83cb000fdb7c466b6d328d52.tar.gz |
Use recommended way to handle utf*.h headers and obsolete symbols
Diffstat (limited to 'ext/intl/grapheme/grapheme_string.c')
-rw-r--r-- | ext/intl/grapheme/grapheme_string.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index f2e29aad27..72ecbd5074 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -24,6 +24,9 @@ #include "grapheme_util.h" #include <unicode/utypes.h> +#if U_ICU_VERSION_MAJOR_NUM >= 49 +#include <unicode/utf8.h> +#endif #include <unicode/ucol.h> #include <unicode/ustring.h> #include <unicode/ubrk.h> @@ -835,10 +838,10 @@ PHP_FUNCTION(grapheme_extract) pstr = str + start; /* just in case pstr points in the middle of a character, move forward to the start of the next char */ - if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) { + if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) { char *str_end = str + str_len; - while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) { + while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) { pstr++; if ( pstr >= str_end ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, |