diff --git a/icu4c/source/common/uprops.c b/icu4c/source/common/uprops.c index 0c5f312cfd8..c7efe52ee98 100644 --- a/icu4c/source/common/uprops.c +++ b/icu4c/source/common/uprops.c @@ -372,6 +372,7 @@ u_getIntPropertyValue(UChar32 c, UProperty which) { return c%JAMO_T_COUNT==0 ? U_HST_LV_SYLLABLE : U_HST_LVT_SYLLABLE; } return U_HST_NOT_APPLICABLE; +#if !UCONFIG_NO_NORMALIZATION case UCHAR_NFD_QUICK_CHECK: case UCHAR_NFKD_QUICK_CHECK: case UCHAR_NFC_QUICK_CHECK: @@ -381,6 +382,7 @@ u_getIntPropertyValue(UChar32 c, UProperty which) { return unorm_getFCD16FromCodePoint(c)>>8; case UCHAR_TRAIL_CANONICAL_COMBINING_CLASS: return unorm_getFCD16FromCodePoint(c)&0xff; +#endif default: return 0; /* undefined */ } @@ -441,12 +443,14 @@ u_getIntPropertyMaxValue(UProperty which) { return max!=0 ? max : (int32_t)USCRIPT_CODE_LIMIT-1; case UCHAR_HANGUL_SYLLABLE_TYPE: return (int32_t)U_HST_COUNT-1; +#if !UCONFIG_NO_NORMALIZATION case UCHAR_NFD_QUICK_CHECK: case UCHAR_NFKD_QUICK_CHECK: return (int32_t)UNORM_YES; /* these are never "maybe", only "no" or "yes" */ case UCHAR_NFC_QUICK_CHECK: case UCHAR_NFKC_QUICK_CHECK: return (int32_t)UNORM_MAYBE; +#endif default: return -1; /* undefined */ } diff --git a/icu4c/source/io/sscanf.c b/icu4c/source/io/sscanf.c index 4d4ad5feac8..a8d564ddf38 100644 --- a/icu4c/source/io/sscanf.c +++ b/icu4c/source/io/sscanf.c @@ -103,7 +103,9 @@ u_vsscanf_u(const UChar *buffer, inStr.fConverter = NULL; inStr.fFile = NULL; inStr.fOwnFile = FALSE; +#if !UCONFIG_NO_TRANSLITERATION inStr.fTranslit = NULL; +#endif inStr.fUCBuffer[0] = 0; inStr.str.fBuffer = (UChar *)buffer; inStr.str.fPos = (UChar *)buffer; diff --git a/icu4c/source/io/unicode/ustdio.h b/icu4c/source/io/unicode/ustdio.h index d6d2341b015..cc0b6d7ae47 100644 --- a/icu4c/source/io/unicode/ustdio.h +++ b/icu4c/source/io/unicode/ustdio.h @@ -354,6 +354,8 @@ u_fsetcodepage(const char *codepage, */ U_CAPI UConverter* U_EXPORT2 u_fgetConverter(UFILE *f); +#if !UCONFIG_NO_FORMATTING + /* Output functions */ /** @@ -415,7 +417,7 @@ U_CAPI int32_t U_EXPORT2 u_vfprintf_u(UFILE *f, const UChar *patternSpecification, va_list ap); - +#endif /** * Write a Unicode to a UFILE. The null (U+0000) terminated UChar* * s will be written to f, excluding the NULL terminator. @@ -459,6 +461,7 @@ u_file_write(const UChar *ustring, /* Input functions */ +#if !UCONFIG_NO_FORMATTING /** * Read formatted data from a UFILE. @@ -523,6 +526,7 @@ U_CAPI int32_t U_EXPORT2 u_vfscanf_u(UFILE *f, const UChar *patternSpecification, va_list ap); +#endif /** * Read one line of text into a UChar* string from a UFILE. The newline @@ -623,6 +627,7 @@ u_fsettransliterator(UFILE *file, UFileDirection direction, /* Output string functions */ +#if !UCONFIG_NO_FORMATTING /** @@ -853,7 +858,7 @@ u_vsscanf_u(const UChar *buffer, const UChar *patternSpecification, va_list ap); - +#endif #endif diff --git a/icu4c/source/test/cintltst/crestst.c b/icu4c/source/test/cintltst/crestst.c index 753c040ab2a..ad12d1055ab 100644 --- a/icu4c/source/test/cintltst/crestst.c +++ b/icu4c/source/test/cintltst/crestst.c @@ -938,6 +938,7 @@ static void TestGetKeywordValues(void) { UBool foundStandard = FALSE; UErrorCode status = U_ZERO_ERROR; const char *kw; +#if !UCONFIG_NO_COLLATION kwVals = ures_getKeywordValues( U_ICUDATA_COLL, "collations", &status); log_verbose("Testing getting collation keyword values:\n"); @@ -960,23 +961,24 @@ static void TestGetKeywordValues(void) { log_err("err %s getting collation values\n", u_errorName(status)); } status = U_ZERO_ERROR; - +#endif + foundStandard = FALSE; kwVals = ures_getKeywordValues( "ICUDATA", "calendar", &status); log_verbose("Testing getting calendar keyword values:\n"); while((kw=uenum_next(kwVals, NULL, &status))) { log_verbose(" %s\n", kw); - if(!strcmp(kw,"standard")) { + if(!strcmp(kw,"japanese")) { if(foundStandard == FALSE) { foundStandard = TRUE; } else { - log_err("'standard' was found twice in the calendar keyword list.\n"); + log_err("'japanese' was found twice in the calendar keyword list.\n"); } } } if(foundStandard == FALSE) { - log_err("'standard' was not found in the calendar keyword list.\n"); + log_err("'japanese' was not found in the calendar keyword list.\n"); } uenum_close(kwVals); if(U_FAILURE(status)) { @@ -1048,9 +1050,12 @@ static void TestGetFunctionalEquivalent(void) { NULL }; +#if !UCONFIG_NO_COLLATION TestGetFunctionalEquivalentOf(U_ICUDATA_COLL, "collations", "collation", TRUE, collCases); +#endif TestGetFunctionalEquivalentOf("ICUDATA", "calendar", "calendar", FALSE, calCases); +#if !UCONFIG_NO_COLLATION log_verbose("Testing error conditions:\n"); { char equivLocale[256] = "???"; @@ -1069,5 +1074,6 @@ static void TestGetFunctionalEquivalent(void) { equivLocale, gotAvail?'t':'f', u_errorName(status)); } } +#endif } diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c index d0bb3918453..4033e7eb11a 100644 --- a/icu4c/source/test/cintltst/creststn.c +++ b/icu4c/source/test/cintltst/creststn.c @@ -2025,11 +2025,8 @@ static void TestResourceLevelAliasing(void) { const UChar *string = NULL, *sequence = NULL; const uint8_t *binary = NULL, *binSequence = NULL; int32_t strLen = 0, seqLen = 0, binLen = 0, binSeqLen = 0; - -#if !UCONFIG_NO_COLLATION char buffer[100]; char *s; -#endif testdatapath=loadTestData(&status); if(U_FAILURE(status)) diff --git a/icu4c/source/test/intltest/intltest.cpp b/icu4c/source/test/intltest/intltest.cpp index 81483ab5d64..222dd0b18f1 100644 --- a/icu4c/source/test/intltest/intltest.cpp +++ b/icu4c/source/test/intltest/intltest.cpp @@ -1439,6 +1439,7 @@ UBool IntlTest::assertEquals(const char* message, return TRUE; } +#if !UCONFIG_NO_FORMATTING UBool IntlTest::assertEquals(const char* message, const Formattable& expected, const Formattable& actual) { @@ -1455,6 +1456,7 @@ UBool IntlTest::assertEquals(const char* message, #endif return TRUE; } +#endif static char ASSERT_BUF[256]; @@ -1490,11 +1492,13 @@ UBool IntlTest::assertEquals(const UnicodeString& message, return assertEquals(extractToAssertBuf(message), expected, actual); } +#if !UCONFIG_NO_FORMATTING UBool IntlTest::assertEquals(const UnicodeString& message, const Formattable& expected, const Formattable& actual) { return assertEquals(extractToAssertBuf(message), expected, actual); } +#endif /* * Hey, Emacs, please set the following: diff --git a/icu4c/source/test/intltest/intltest.h b/icu4c/source/test/intltest/intltest.h index 4c299d1ed01..4a12879d03d 100644 --- a/icu4c/source/test/intltest/intltest.h +++ b/icu4c/source/test/intltest/intltest.h @@ -140,8 +140,12 @@ protected: const UnicodeString& actual); UBool assertEquals(const char* message, const char* expected, const char* actual); +#if !UCONFIG_NO_FORMATTING UBool assertEquals(const char* message, const Formattable& expected, const Formattable& actual); + UBool assertEquals(const UnicodeString& message, const Formattable& expected, + const Formattable& actual); +#endif UBool assertTrue(const UnicodeString& message, UBool condition, UBool quiet=FALSE); UBool assertFalse(const UnicodeString& message, UBool condition, UBool quiet=FALSE); UBool assertSuccess(const UnicodeString& message, UErrorCode ec); @@ -149,8 +153,6 @@ protected: const UnicodeString& actual); UBool assertEquals(const UnicodeString& message, const char* expected, const char* actual); - UBool assertEquals(const UnicodeString& message, const Formattable& expected, - const Formattable& actual); virtual void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ); // overide ! diff --git a/icu4c/source/test/intltest/rbbitst.cpp b/icu4c/source/test/intltest/rbbitst.cpp index 8f0699b975d..0387d3d20c2 100644 --- a/icu4c/source/test/intltest/rbbitst.cpp +++ b/icu4c/source/test/intltest/rbbitst.cpp @@ -3132,6 +3132,8 @@ static void testBreakBoundPreceding(RBBITest *test, UnicodeString ustr, void RBBITest::TestWordBreaks(void) { +#if !UCONFIG_NO_REGULAR_EXPRESSIONS + // <>\u1d4a\u206e\u0603\U0001d7ff<>\u2019<> Locale locale("en"); UErrorCode status = U_ZERO_ERROR; @@ -3200,6 +3202,7 @@ void RBBITest::TestWordBreaks(void) testBreakBoundPreceding(this, ustr, bi, expected, expectedcount); } delete bi; +#endif } void RBBITest::TestWordBoundary(void) @@ -3280,6 +3283,7 @@ void RBBITest::TestWordBoundary(void) void RBBITest::TestLineBreaks(void) { +#if !UCONFIG_NO_REGULAR_EXPRESSIONS Locale locale("en"); UErrorCode status = U_ZERO_ERROR; BreakIterator *bi = BreakIterator::createLineInstance(locale, status); @@ -3343,6 +3347,7 @@ void RBBITest::TestLineBreaks(void) testBreakBoundPreceding(this, ustr, bi, expected, expectedcount); } delete bi; +#endif } void RBBITest::TestSentBreaks(void) diff --git a/icu4c/source/test/intltest/svccoll.cpp b/icu4c/source/test/intltest/svccoll.cpp index aead7a7ee88..792667b4fe1 100644 --- a/icu4c/source/test/intltest/svccoll.cpp +++ b/icu4c/source/test/intltest/svccoll.cpp @@ -491,7 +491,11 @@ int32_t CollationServiceTest::checkStringEnumeration(const char* msg, } } // can't get pesky operator+(const US&, foo) to cooperate; use toString +#if !UCONFIG_NO_FORMATTING logln(UnicodeString() + msg + " = [" + buf + "] (" + toString(i) + ")"); +#else + logln(UnicodeString() + msg + " = [" + buf + "] (??? NO_FORMATTING)"); +#endif assertTrue("count verified", i==n); // did we see all expected strings? if (((1<