Skip to content

Instantly share code, notes, and snippets.

@Maksold
Created May 3, 2022 05:00
Show Gist options
  • Save Maksold/ea0c8d4d4fb15e2586d28886062e8a42 to your computer and use it in GitHub Desktop.
Save Maksold/ea0c8d4d4fb15e2586d28886062e8a42 to your computer and use it in GitHub Desktop.
--- ext/intl/breakiterator/codepointiterator_internal.cpp
+++ ext/intl/breakiterator/codepointiterator_internal.cpp
@@ -67,21 +67,25 @@
}
CodePointBreakIterator::~CodePointBreakIterator()
{
if (this->fText) {
utext_close(this->fText);
}
clearCurrentCharIter();
}
-UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
+#if U_ICU_VERSION_MAJOR_NUM >= 70
+ bool CodePointBreakIterator::operator==(const BreakIterator& that) const
+#else
+ UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
+#endif
{
if (typeid(*this) != typeid(that)) {
return FALSE;
}
const CodePointBreakIterator& that2 =
static_cast<const CodePointBreakIterator&>(that);
if (!utext_equals(this->fText, that2.fText)) {
return FALSE;
--- ext/intl/breakiterator/codepointiterator_internal.h
+++ ext/intl/breakiterator/codepointiterator_internal.h
@@ -29,21 +29,25 @@
static UClassID getStaticClassID();
CodePointBreakIterator();
CodePointBreakIterator(const CodePointBreakIterator &other);
CodePointBreakIterator& operator=(const CodePointBreakIterator& that);
virtual ~CodePointBreakIterator();
+#if U_ICU_VERSION_MAJOR_NUM >= 70
+ virtual bool operator==(const BreakIterator& that) const;
+#else
virtual UBool operator==(const BreakIterator& that) const;
+#endif
virtual CodePointBreakIterator* clone(void) const;
virtual UClassID getDynamicClassID(void) const;
virtual CharacterIterator& getText(void) const;
virtual UText *getUText(UText *fillIn, UErrorCode &status) const;
virtual void setText(const UnicodeString &text);
--- ext/intl/locale/locale_methods.c
+++ ext/intl/locale/locale_methods.c
@@ -1335,11 +1335,11 @@
token = strstr( cur_lang_tag , cur_loc_range );
if( token && (token==cur_lang_tag) ){
/* check if the char. after match is SEPARATOR */
chrcheck = token + (strlen(cur_loc_range));
- if( isIDSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
+ if( isIDSeparator(*chrcheck) || isKeywordSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
if( cur_lang_tag){
efree( cur_lang_tag );
}
if( cur_loc_range){
efree( cur_loc_range );
@@ -1391,11 +1391,11 @@
token = strstr( cur_lang_tag , cur_loc_range );
if( token && (token==cur_lang_tag) ){
/* check if the char. after match is SEPARATOR */
chrcheck = token + (strlen(cur_loc_range));
- if( isIDSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
+ if( isIDSeparator(*chrcheck) || isKeywordSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
if( cur_lang_tag){
efree( cur_lang_tag );
}
if( cur_loc_range){
efree( cur_loc_range );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment