From 11c0df4f7bdd45e479da2dd798e151366733fa0e Mon Sep 17 00:00:00 2001 From: Peter Edberg Date: Wed, 28 Sep 2016 07:37:19 +0000 Subject: [PATCH] ICU-12738 ICU4C BRS, fixes from testing uconfig.h variations X-SVN-Rev: 39378 --- icu4c/source/common/brkiter.cpp | 2 ++ icu4c/source/common/locdspnm.cpp | 8 +++++++- icu4c/source/common/unicode/unistr.h | 2 ++ icu4c/source/i18n/reldtfmt.cpp | 4 ++-- icu4c/source/i18n/reldtfmt.h | 5 ++++- icu4c/source/i18n/unicode/reldatefmt.h | 8 +++++--- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/icu4c/source/common/brkiter.cpp b/icu4c/source/common/brkiter.cpp index 66dba39c182..029ec5e185d 100644 --- a/icu4c/source/common/brkiter.cpp +++ b/icu4c/source/common/brkiter.cpp @@ -420,6 +420,7 @@ BreakIterator::makeInstance(const Locale& loc, int32_t kind, UErrorCode& status) break; case UBRK_SENTENCE: result = BreakIterator::buildInstance(loc, "sentence", kind, status); +#if !UCONFIG_NO_FILTERED_BREAK_ITERATION { char ssKeyValue[kKeyValueLenMax] = {0}; UErrorCode kvStatus = U_ZERO_ERROR; @@ -432,6 +433,7 @@ BreakIterator::makeInstance(const Locale& loc, int32_t kind, UErrorCode& status) } } } +#endif break; case UBRK_TITLE: result = BreakIterator::buildInstance(loc, "title", kind, status); diff --git a/icu4c/source/common/locdspnm.cpp b/icu4c/source/common/locdspnm.cpp index 83f8c771ba4..a17478ce6d8 100644 --- a/icu4c/source/common/locdspnm.cpp +++ b/icu4c/source/common/locdspnm.cpp @@ -280,7 +280,11 @@ class LocaleDisplayNamesImpl : public LocaleDisplayNames { SimpleFormatter format; SimpleFormatter keyTypeFormat; UDisplayContext capitalizationContext; +#if !UCONFIG_NO_BREAK_ITERATION BreakIterator* capitalizationBrkIter; +#else + UObject* capitalizationBrkIter; +#endif static UMutex capitalizationBrkIterLock; UnicodeString formatOpenParen; UnicodeString formatReplaceOpenParen; @@ -509,8 +513,10 @@ LocaleDisplayNamesImpl::initialize(void) { } LocaleDisplayNamesImpl::~LocaleDisplayNamesImpl() { +#if !UCONFIG_NO_BREAK_ITERATION delete capitalizationBrkIter; - } +#endif +} const Locale& LocaleDisplayNamesImpl::getLocale() const { diff --git a/icu4c/source/common/unicode/unistr.h b/icu4c/source/common/unicode/unistr.h index 81ba2c5ca19..6f62244a1e2 100644 --- a/icu4c/source/common/unicode/unistr.h +++ b/icu4c/source/common/unicode/unistr.h @@ -76,7 +76,9 @@ UStringCaseMapper(const UCaseMap *csm, U_NAMESPACE_BEGIN +#if !UCONFIG_NO_BREAK_ITERATION class BreakIterator; // unicode/brkiter.h +#endif class Locale; // unicode/locid.h class StringCharacterIterator; class UnicodeStringAppendable; // unicode/appendable.h diff --git a/icu4c/source/i18n/reldtfmt.cpp b/icu4c/source/i18n/reldtfmt.cpp index b2ae37808cf..00cafc84e4c 100644 --- a/icu4c/source/i18n/reldtfmt.cpp +++ b/icu4c/source/i18n/reldtfmt.cpp @@ -13,7 +13,6 @@ #include -#include "reldtfmt.h" #include "unicode/datefmt.h" #include "unicode/reldatefmt.h" #include "unicode/simpleformatter.h" @@ -22,6 +21,7 @@ #include "unicode/uchar.h" #include "unicode/brkiter.h" +#include "reldtfmt.h" #include "cmemory.h" #include "uresimp.h" @@ -592,4 +592,4 @@ int32_t RelativeDateFormat::dayDifference(Calendar &cal, UErrorCode &status) { U_NAMESPACE_END -#endif +#endif /* !UCONFIG_NO_FORMATTING */ diff --git a/icu4c/source/i18n/reldtfmt.h b/icu4c/source/i18n/reldtfmt.h index 14d82864eac..3a11dfb150d 100644 --- a/icu4c/source/i18n/reldtfmt.h +++ b/icu4c/source/i18n/reldtfmt.h @@ -264,7 +264,11 @@ private: UBool fCapitalizationInfoSet; UBool fCapitalizationOfRelativeUnitsForUIListMenu; UBool fCapitalizationOfRelativeUnitsForStandAlone; +#if !UCONFIG_NO_BREAK_ITERATION BreakIterator* fCapitalizationBrkIter; +#else + UObject* fCapitalizationBrkIter; +#endif /** * Get the string at a specific offset. @@ -333,4 +337,3 @@ U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ #endif // RELDTFMT_H -//eof diff --git a/icu4c/source/i18n/unicode/reldatefmt.h b/icu4c/source/i18n/unicode/reldatefmt.h index e3ed5914aaf..e91d20667e3 100644 --- a/icu4c/source/i18n/unicode/reldatefmt.h +++ b/icu4c/source/i18n/unicode/reldatefmt.h @@ -25,7 +25,7 @@ * \brief C++ API: Formats relative dates such as "1 day ago" or "tomorrow" */ -#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION +#if !UCONFIG_NO_FORMATTING /** * Represents the unit for formatting a relative date. e.g "in 5 days" @@ -226,6 +226,7 @@ typedef enum UDateDirection { #endif // U_HIDE_DEPRECATED_API } UDateDirection; +#if !UCONFIG_NO_BREAK_ITERATION U_NAMESPACE_BEGIN @@ -517,5 +518,6 @@ private: U_NAMESPACE_END -#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION*/ -#endif +#endif /* !UCONFIG_NO_BREAK_ITERATION */ +#endif /* !UCONFIG_NO_FORMATTING */ +#endif /* __RELDATEFMT_H */ -- 2.40.0