You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.9 KiB

  1. From cd1447a6962496fca60a2f5e5d9cf4448575cc24 Mon Sep 17 00:00:00 2001
  2. From: Ben Ramsey <ramsey@php.net>
  3. Date: Tue, 19 Oct 2021 23:59:11 -0500
  4. Subject: [PATCH 1/4] Change UBool to bool for equality operators in ICU >=
  5. 70.1
  6. Refer to:
  7. - https://github.com/unicode-org/icu/commit/633438f8da99fee815e2c61626ea779a84567a3d
  8. - https://github.com/unicode-org/icu/commit/f6325d49ba57ec26f320b2865ce09ca47db458d9
  9. ---
  10. ext/intl/breakiterator/codepointiterator_internal.cpp | 4 ++++
  11. ext/intl/breakiterator/codepointiterator_internal.h | 4 ++++
  12. 2 files changed, 8 insertions(+)
  13. --- a/ext/intl/breakiterator/codepointiterator_internal.cpp
  14. +++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
  15. @@ -73,7 +73,11 @@ CodePointBreakIterator::~CodePointBreakI
  16. clearCurrentCharIter();
  17. }
  18. +#if U_ICU_VERSION_MAJOR_NUM >= 70
  19. +bool CodePointBreakIterator::operator==(const BreakIterator& that) const
  20. +#else
  21. UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
  22. +#endif
  23. {
  24. if (typeid(*this) != typeid(that)) {
  25. return false;
  26. --- a/ext/intl/breakiterator/codepointiterator_internal.h
  27. +++ b/ext/intl/breakiterator/codepointiterator_internal.h
  28. @@ -37,7 +37,11 @@ namespace PHP {
  29. virtual ~CodePointBreakIterator();
  30. +#if U_ICU_VERSION_MAJOR_NUM >= 70
  31. + virtual bool operator==(const BreakIterator& that) const;
  32. +#else
  33. virtual UBool operator==(const BreakIterator& that) const;
  34. +#endif
  35. virtual CodePointBreakIterator* clone(void) const;
  36. --- a/ext/intl/locale/locale_methods.c
  37. +++ b/ext/intl/locale/locale_methods.c
  38. @@ -1239,7 +1239,7 @@ PHP_FUNCTION(locale_filter_matches)
  39. if( token && (token==cur_lang_tag) ){
  40. /* check if the char. after match is SEPARATOR */
  41. chrcheck = token + (strlen(cur_loc_range));
  42. - if( isIDSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
  43. + if( isIDSeparator(*chrcheck) || isKeywordSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
  44. efree( cur_lang_tag );
  45. efree( cur_loc_range );
  46. if( can_lang_tag){