forked from mirrors/gecko-dev
Bug 1814862 - Build ICU with UCONFIG_NO_BREAK_ITERATION r=anba
Differential Revision: https://phabricator.services.mozilla.com/D168970
This commit is contained in:
parent
2ba28ed192
commit
2dbc784d5a
5 changed files with 239 additions and 6 deletions
1
config/external/icu/defs.mozbuild
vendored
1
config/external/icu/defs.mozbuild
vendored
|
|
@ -16,6 +16,7 @@ DEFINES['U_HIDE_OBSOLETE_UTF_OLD_H'] = 1
|
||||||
DEFINES['UCONFIG_NO_LEGACY_CONVERSION'] = True
|
DEFINES['UCONFIG_NO_LEGACY_CONVERSION'] = True
|
||||||
DEFINES['UCONFIG_NO_TRANSLITERATION'] = True
|
DEFINES['UCONFIG_NO_TRANSLITERATION'] = True
|
||||||
DEFINES['UCONFIG_NO_REGULAR_EXPRESSIONS'] = True
|
DEFINES['UCONFIG_NO_REGULAR_EXPRESSIONS'] = True
|
||||||
|
DEFINES['UCONFIG_NO_BREAK_ITERATION'] = True
|
||||||
|
|
||||||
# We don't need to pass data to and from legacy char* APIs.
|
# We don't need to pass data to and from legacy char* APIs.
|
||||||
DEFINES['U_CHARSET_IS_UTF8'] = True
|
DEFINES['U_CHARSET_IS_UTF8'] = True
|
||||||
|
|
|
||||||
201
intl/icu-patches/bug-1814862-ICU-22260.diff
Normal file
201
intl/icu-patches/bug-1814862-ICU-22260.diff
Normal file
|
|
@ -0,0 +1,201 @@
|
||||||
|
# Support relative date formatting with UCONFIG_NO_BREAK_ITERATION
|
||||||
|
#
|
||||||
|
# ICU bug: https://unicode-org.atlassian.net/browse/ICU-22260
|
||||||
|
|
||||||
|
diff --git a/intl/icu/source/i18n/reldatefmt.cpp b/intl/icu/source/i18n/reldatefmt.cpp
|
||||||
|
index 24d22a4b4b..6a0c9e65ef 100644
|
||||||
|
--- a/intl/icu/source/i18n/reldatefmt.cpp
|
||||||
|
+++ b/intl/icu/source/i18n/reldatefmt.cpp
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
|
||||||
|
#include "unicode/reldatefmt.h"
|
||||||
|
|
||||||
|
-#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
+#if !UCONFIG_NO_FORMATTING
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <functional>
|
||||||
|
@@ -761,6 +761,7 @@ RelativeDateTimeFormatter::RelativeDateTimeFormatter(UErrorCode& status) :
|
||||||
|
fStyle(UDAT_STYLE_LONG),
|
||||||
|
fContext(UDISPCTX_CAPITALIZATION_NONE),
|
||||||
|
fOptBreakIterator(nullptr) {
|
||||||
|
+ (void)fOptBreakIterator; // suppress unused field warning
|
||||||
|
init(nullptr, nullptr, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -809,11 +810,16 @@ RelativeDateTimeFormatter::RelativeDateTimeFormatter(
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE) {
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
BreakIterator *bi = BreakIterator::createSentenceInstance(locale, status);
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
init(nfToAdopt, bi, status);
|
||||||
|
+#else
|
||||||
|
+ status = U_UNSUPPORTED_ERROR;
|
||||||
|
+ return;
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
} else {
|
||||||
|
init(nfToAdopt, nullptr, status);
|
||||||
|
}
|
||||||
|
@@ -832,9 +838,11 @@ RelativeDateTimeFormatter::RelativeDateTimeFormatter(
|
||||||
|
fCache->addRef();
|
||||||
|
fNumberFormat->addRef();
|
||||||
|
fPluralRules->addRef();
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
if (fOptBreakIterator != nullptr) {
|
||||||
|
fOptBreakIterator->addRef();
|
||||||
|
}
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
}
|
||||||
|
|
||||||
|
RelativeDateTimeFormatter& RelativeDateTimeFormatter::operator=(
|
||||||
|
@@ -843,7 +851,9 @@ RelativeDateTimeFormatter& RelativeDateTimeFormatter::operator=(
|
||||||
|
SharedObject::copyPtr(other.fCache, fCache);
|
||||||
|
SharedObject::copyPtr(other.fNumberFormat, fNumberFormat);
|
||||||
|
SharedObject::copyPtr(other.fPluralRules, fPluralRules);
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
SharedObject::copyPtr(other.fOptBreakIterator, fOptBreakIterator);
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
fStyle = other.fStyle;
|
||||||
|
fContext = other.fContext;
|
||||||
|
fLocale = other.fLocale;
|
||||||
|
@@ -861,9 +871,11 @@ RelativeDateTimeFormatter::~RelativeDateTimeFormatter() {
|
||||||
|
if (fPluralRules != nullptr) {
|
||||||
|
fPluralRules->removeRef();
|
||||||
|
}
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
if (fOptBreakIterator != nullptr) {
|
||||||
|
fOptBreakIterator->removeRef();
|
||||||
|
}
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
}
|
||||||
|
|
||||||
|
const NumberFormat& RelativeDateTimeFormatter::getNumberFormat() const {
|
||||||
|
@@ -1191,6 +1203,7 @@ UnicodeString& RelativeDateTimeFormatter::combineDateAndTime(
|
||||||
|
}
|
||||||
|
|
||||||
|
UnicodeString& RelativeDateTimeFormatter::adjustForContext(UnicodeString &str) const {
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
if (fOptBreakIterator == nullptr
|
||||||
|
|| str.length() == 0 || !u_islower(str.char32At(0))) {
|
||||||
|
return str;
|
||||||
|
@@ -1204,25 +1217,36 @@ UnicodeString& RelativeDateTimeFormatter::adjustForContext(UnicodeString &str) c
|
||||||
|
fOptBreakIterator->get(),
|
||||||
|
fLocale,
|
||||||
|
U_TITLECASE_NO_LOWERCASE | U_TITLECASE_NO_BREAK_ADJUSTMENT);
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBool RelativeDateTimeFormatter::checkNoAdjustForContext(UErrorCode& status) const {
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
// This is unsupported because it's hard to keep fields in sync with title
|
||||||
|
// casing. The code could be written and tested if there is demand.
|
||||||
|
if (fOptBreakIterator != nullptr) {
|
||||||
|
status = U_UNSUPPORTED_ERROR;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
+#else
|
||||||
|
+ (void)status; // suppress unused argument warning
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RelativeDateTimeFormatter::init(
|
||||||
|
NumberFormat *nfToAdopt,
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
BreakIterator *biToAdopt,
|
||||||
|
+#else
|
||||||
|
+ std::nullptr_t,
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
UErrorCode &status) {
|
||||||
|
LocalPointer<NumberFormat> nf(nfToAdopt);
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
LocalPointer<BreakIterator> bi(biToAdopt);
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
UnifiedCache::getByLocale(fLocale, fCache, status);
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
return;
|
||||||
|
@@ -1251,6 +1275,7 @@ void RelativeDateTimeFormatter::init(
|
||||||
|
nf.orphan();
|
||||||
|
SharedObject::copyPtr(shared, fNumberFormat);
|
||||||
|
}
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
if (bi.isNull()) {
|
||||||
|
SharedObject::clearPtr(fOptBreakIterator);
|
||||||
|
} else {
|
||||||
|
@@ -1262,6 +1287,7 @@ void RelativeDateTimeFormatter::init(
|
||||||
|
bi.orphan();
|
||||||
|
SharedObject::copyPtr(shared, fOptBreakIterator);
|
||||||
|
}
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
}
|
||||||
|
|
||||||
|
U_NAMESPACE_END
|
||||||
|
diff --git a/intl/icu/source/i18n/unicode/reldatefmt.h b/intl/icu/source/i18n/unicode/reldatefmt.h
|
||||||
|
index 4123468c65..5dc4905b12 100644
|
||||||
|
--- a/intl/icu/source/i18n/unicode/reldatefmt.h
|
||||||
|
+++ b/intl/icu/source/i18n/unicode/reldatefmt.h
|
||||||
|
@@ -248,8 +248,6 @@ typedef enum UDateDirection {
|
||||||
|
#endif // U_HIDE_DEPRECATED_API
|
||||||
|
} UDateDirection;
|
||||||
|
|
||||||
|
-#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
-
|
||||||
|
U_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
class BreakIterator;
|
||||||
|
@@ -696,11 +694,19 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
|
||||||
|
const SharedPluralRules *fPluralRules;
|
||||||
|
UDateRelativeDateTimeFormatterStyle fStyle;
|
||||||
|
UDisplayContext fContext;
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
const SharedBreakIterator *fOptBreakIterator;
|
||||||
|
+#else
|
||||||
|
+ std::nullptr_t fOptBreakIterator = nullptr;
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
Locale fLocale;
|
||||||
|
void init(
|
||||||
|
NumberFormat *nfToAdopt,
|
||||||
|
+#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
BreakIterator *brkIter,
|
||||||
|
+#else
|
||||||
|
+ std::nullptr_t,
|
||||||
|
+#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
UErrorCode &status);
|
||||||
|
UnicodeString& adjustForContext(UnicodeString &) const;
|
||||||
|
UBool checkNoAdjustForContext(UErrorCode& status) const;
|
||||||
|
@@ -743,7 +749,6 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
|
||||||
|
|
||||||
|
U_NAMESPACE_END
|
||||||
|
|
||||||
|
-#endif /* !UCONFIG_NO_BREAK_ITERATION */
|
||||||
|
#endif /* !UCONFIG_NO_FORMATTING */
|
||||||
|
|
||||||
|
#endif /* U_SHOW_CPLUSPLUS_API */
|
||||||
|
diff --git a/intl/icu/source/i18n/unicode/ureldatefmt.h b/intl/icu/source/i18n/unicode/ureldatefmt.h
|
||||||
|
index 3c44890043..0882360d14 100644
|
||||||
|
--- a/intl/icu/source/i18n/unicode/ureldatefmt.h
|
||||||
|
+++ b/intl/icu/source/i18n/unicode/ureldatefmt.h
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
|
||||||
|
#include "unicode/utypes.h"
|
||||||
|
|
||||||
|
-#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
+#if !UCONFIG_NO_FORMATTING
|
||||||
|
|
||||||
|
#include "unicode/unum.h"
|
||||||
|
#include "unicode/udisplaycontext.h"
|
||||||
|
@@ -505,6 +505,6 @@ ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
|
||||||
|
int32_t resultCapacity,
|
||||||
|
UErrorCode* status );
|
||||||
|
|
||||||
|
-#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */
|
||||||
|
+#endif /* !UCONFIG_NO_FORMATTING */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "unicode/reldatefmt.h"
|
#include "unicode/reldatefmt.h"
|
||||||
|
|
||||||
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
#if !UCONFIG_NO_FORMATTING
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
@ -761,6 +761,7 @@ RelativeDateTimeFormatter::RelativeDateTimeFormatter(UErrorCode& status) :
|
||||||
fStyle(UDAT_STYLE_LONG),
|
fStyle(UDAT_STYLE_LONG),
|
||||||
fContext(UDISPCTX_CAPITALIZATION_NONE),
|
fContext(UDISPCTX_CAPITALIZATION_NONE),
|
||||||
fOptBreakIterator(nullptr) {
|
fOptBreakIterator(nullptr) {
|
||||||
|
(void)fOptBreakIterator; // suppress unused field warning
|
||||||
init(nullptr, nullptr, status);
|
init(nullptr, nullptr, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -809,11 +810,16 @@ RelativeDateTimeFormatter::RelativeDateTimeFormatter(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE) {
|
if (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE) {
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
BreakIterator *bi = BreakIterator::createSentenceInstance(locale, status);
|
BreakIterator *bi = BreakIterator::createSentenceInstance(locale, status);
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
init(nfToAdopt, bi, status);
|
init(nfToAdopt, bi, status);
|
||||||
|
#else
|
||||||
|
status = U_UNSUPPORTED_ERROR;
|
||||||
|
return;
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
} else {
|
} else {
|
||||||
init(nfToAdopt, nullptr, status);
|
init(nfToAdopt, nullptr, status);
|
||||||
}
|
}
|
||||||
|
|
@ -832,9 +838,11 @@ RelativeDateTimeFormatter::RelativeDateTimeFormatter(
|
||||||
fCache->addRef();
|
fCache->addRef();
|
||||||
fNumberFormat->addRef();
|
fNumberFormat->addRef();
|
||||||
fPluralRules->addRef();
|
fPluralRules->addRef();
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
if (fOptBreakIterator != nullptr) {
|
if (fOptBreakIterator != nullptr) {
|
||||||
fOptBreakIterator->addRef();
|
fOptBreakIterator->addRef();
|
||||||
}
|
}
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
}
|
}
|
||||||
|
|
||||||
RelativeDateTimeFormatter& RelativeDateTimeFormatter::operator=(
|
RelativeDateTimeFormatter& RelativeDateTimeFormatter::operator=(
|
||||||
|
|
@ -843,7 +851,9 @@ RelativeDateTimeFormatter& RelativeDateTimeFormatter::operator=(
|
||||||
SharedObject::copyPtr(other.fCache, fCache);
|
SharedObject::copyPtr(other.fCache, fCache);
|
||||||
SharedObject::copyPtr(other.fNumberFormat, fNumberFormat);
|
SharedObject::copyPtr(other.fNumberFormat, fNumberFormat);
|
||||||
SharedObject::copyPtr(other.fPluralRules, fPluralRules);
|
SharedObject::copyPtr(other.fPluralRules, fPluralRules);
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
SharedObject::copyPtr(other.fOptBreakIterator, fOptBreakIterator);
|
SharedObject::copyPtr(other.fOptBreakIterator, fOptBreakIterator);
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
fStyle = other.fStyle;
|
fStyle = other.fStyle;
|
||||||
fContext = other.fContext;
|
fContext = other.fContext;
|
||||||
fLocale = other.fLocale;
|
fLocale = other.fLocale;
|
||||||
|
|
@ -861,9 +871,11 @@ RelativeDateTimeFormatter::~RelativeDateTimeFormatter() {
|
||||||
if (fPluralRules != nullptr) {
|
if (fPluralRules != nullptr) {
|
||||||
fPluralRules->removeRef();
|
fPluralRules->removeRef();
|
||||||
}
|
}
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
if (fOptBreakIterator != nullptr) {
|
if (fOptBreakIterator != nullptr) {
|
||||||
fOptBreakIterator->removeRef();
|
fOptBreakIterator->removeRef();
|
||||||
}
|
}
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
}
|
}
|
||||||
|
|
||||||
const NumberFormat& RelativeDateTimeFormatter::getNumberFormat() const {
|
const NumberFormat& RelativeDateTimeFormatter::getNumberFormat() const {
|
||||||
|
|
@ -1191,6 +1203,7 @@ UnicodeString& RelativeDateTimeFormatter::combineDateAndTime(
|
||||||
}
|
}
|
||||||
|
|
||||||
UnicodeString& RelativeDateTimeFormatter::adjustForContext(UnicodeString &str) const {
|
UnicodeString& RelativeDateTimeFormatter::adjustForContext(UnicodeString &str) const {
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
if (fOptBreakIterator == nullptr
|
if (fOptBreakIterator == nullptr
|
||||||
|| str.length() == 0 || !u_islower(str.char32At(0))) {
|
|| str.length() == 0 || !u_islower(str.char32At(0))) {
|
||||||
return str;
|
return str;
|
||||||
|
|
@ -1204,25 +1217,36 @@ UnicodeString& RelativeDateTimeFormatter::adjustForContext(UnicodeString &str) c
|
||||||
fOptBreakIterator->get(),
|
fOptBreakIterator->get(),
|
||||||
fLocale,
|
fLocale,
|
||||||
U_TITLECASE_NO_LOWERCASE | U_TITLECASE_NO_BREAK_ADJUSTMENT);
|
U_TITLECASE_NO_LOWERCASE | U_TITLECASE_NO_BREAK_ADJUSTMENT);
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
UBool RelativeDateTimeFormatter::checkNoAdjustForContext(UErrorCode& status) const {
|
UBool RelativeDateTimeFormatter::checkNoAdjustForContext(UErrorCode& status) const {
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
// This is unsupported because it's hard to keep fields in sync with title
|
// This is unsupported because it's hard to keep fields in sync with title
|
||||||
// casing. The code could be written and tested if there is demand.
|
// casing. The code could be written and tested if there is demand.
|
||||||
if (fOptBreakIterator != nullptr) {
|
if (fOptBreakIterator != nullptr) {
|
||||||
status = U_UNSUPPORTED_ERROR;
|
status = U_UNSUPPORTED_ERROR;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)status; // suppress unused argument warning
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RelativeDateTimeFormatter::init(
|
void RelativeDateTimeFormatter::init(
|
||||||
NumberFormat *nfToAdopt,
|
NumberFormat *nfToAdopt,
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
BreakIterator *biToAdopt,
|
BreakIterator *biToAdopt,
|
||||||
|
#else
|
||||||
|
std::nullptr_t,
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
UErrorCode &status) {
|
UErrorCode &status) {
|
||||||
LocalPointer<NumberFormat> nf(nfToAdopt);
|
LocalPointer<NumberFormat> nf(nfToAdopt);
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
LocalPointer<BreakIterator> bi(biToAdopt);
|
LocalPointer<BreakIterator> bi(biToAdopt);
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
UnifiedCache::getByLocale(fLocale, fCache, status);
|
UnifiedCache::getByLocale(fLocale, fCache, status);
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -1251,6 +1275,7 @@ void RelativeDateTimeFormatter::init(
|
||||||
nf.orphan();
|
nf.orphan();
|
||||||
SharedObject::copyPtr(shared, fNumberFormat);
|
SharedObject::copyPtr(shared, fNumberFormat);
|
||||||
}
|
}
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
if (bi.isNull()) {
|
if (bi.isNull()) {
|
||||||
SharedObject::clearPtr(fOptBreakIterator);
|
SharedObject::clearPtr(fOptBreakIterator);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1262,6 +1287,7 @@ void RelativeDateTimeFormatter::init(
|
||||||
bi.orphan();
|
bi.orphan();
|
||||||
SharedObject::copyPtr(shared, fOptBreakIterator);
|
SharedObject::copyPtr(shared, fOptBreakIterator);
|
||||||
}
|
}
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
}
|
}
|
||||||
|
|
||||||
U_NAMESPACE_END
|
U_NAMESPACE_END
|
||||||
|
|
|
||||||
|
|
@ -248,8 +248,6 @@ typedef enum UDateDirection {
|
||||||
#endif // U_HIDE_DEPRECATED_API
|
#endif // U_HIDE_DEPRECATED_API
|
||||||
} UDateDirection;
|
} UDateDirection;
|
||||||
|
|
||||||
#if !UCONFIG_NO_BREAK_ITERATION
|
|
||||||
|
|
||||||
U_NAMESPACE_BEGIN
|
U_NAMESPACE_BEGIN
|
||||||
|
|
||||||
class BreakIterator;
|
class BreakIterator;
|
||||||
|
|
@ -696,11 +694,19 @@ private:
|
||||||
const SharedPluralRules *fPluralRules;
|
const SharedPluralRules *fPluralRules;
|
||||||
UDateRelativeDateTimeFormatterStyle fStyle;
|
UDateRelativeDateTimeFormatterStyle fStyle;
|
||||||
UDisplayContext fContext;
|
UDisplayContext fContext;
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
const SharedBreakIterator *fOptBreakIterator;
|
const SharedBreakIterator *fOptBreakIterator;
|
||||||
|
#else
|
||||||
|
std::nullptr_t fOptBreakIterator = nullptr;
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
Locale fLocale;
|
Locale fLocale;
|
||||||
void init(
|
void init(
|
||||||
NumberFormat *nfToAdopt,
|
NumberFormat *nfToAdopt,
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
BreakIterator *brkIter,
|
BreakIterator *brkIter,
|
||||||
|
#else
|
||||||
|
std::nullptr_t,
|
||||||
|
#endif // !UCONFIG_NO_BREAK_ITERATION
|
||||||
UErrorCode &status);
|
UErrorCode &status);
|
||||||
UnicodeString& adjustForContext(UnicodeString &) const;
|
UnicodeString& adjustForContext(UnicodeString &) const;
|
||||||
UBool checkNoAdjustForContext(UErrorCode& status) const;
|
UBool checkNoAdjustForContext(UErrorCode& status) const;
|
||||||
|
|
@ -743,7 +749,6 @@ private:
|
||||||
|
|
||||||
U_NAMESPACE_END
|
U_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* !UCONFIG_NO_BREAK_ITERATION */
|
|
||||||
#endif /* !UCONFIG_NO_FORMATTING */
|
#endif /* !UCONFIG_NO_FORMATTING */
|
||||||
|
|
||||||
#endif /* U_SHOW_CPLUSPLUS_API */
|
#endif /* U_SHOW_CPLUSPLUS_API */
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "unicode/utypes.h"
|
#include "unicode/utypes.h"
|
||||||
|
|
||||||
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
#if !UCONFIG_NO_FORMATTING
|
||||||
|
|
||||||
#include "unicode/unum.h"
|
#include "unicode/unum.h"
|
||||||
#include "unicode/udisplaycontext.h"
|
#include "unicode/udisplaycontext.h"
|
||||||
|
|
@ -505,6 +505,6 @@ ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
|
||||||
int32_t resultCapacity,
|
int32_t resultCapacity,
|
||||||
UErrorCode* status );
|
UErrorCode* status );
|
||||||
|
|
||||||
#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */
|
#endif /* !UCONFIG_NO_FORMATTING */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue