]> granicus.if.org Git - icu/commitdiff
ICU-9551 fix uconfig failures that were in m2, disable CJKBreak without normalization...
authorSteven R. Loomis <srl@icu-project.org>
Tue, 11 Sep 2012 04:02:08 +0000 (04:02 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Tue, 11 Sep 2012 04:02:08 +0000 (04:02 +0000)
X-SVN-Rev: 32367

icu4c/source/common/brkeng.cpp
icu4c/source/common/dictbe.cpp
icu4c/source/common/dictbe.h
icu4c/source/common/dictionarydata.cpp
icu4c/source/test/hdrtst/cxxfiles.txt
icu4c/source/test/intltest/testidna.cpp
icu4c/source/tools/gendict/gendict.cpp

index 381ce7dd3d1db9747e9cf11f0d3307ffbcc8c951..fa13bb83b9393eb592794157a1c86a594ef971d5 100644 (file)
@@ -231,7 +231,9 @@ ICULanguageBreakFactory::loadEngineFor(UChar32 c, int32_t breakType) {
             case USCRIPT_KHMER:
                 engine = new KhmerBreakEngine(m, status);
                 break;
-                
+
+#if !UCONFIG_NO_NORMALIZATION
+                // CJK not available w/o normalization
             case USCRIPT_HANGUL:
                 engine = new CjkBreakEngine(m, kKorean, status);
                 break;
@@ -255,6 +257,8 @@ ICULanguageBreakFactory::loadEngineFor(UChar32 c, int32_t breakType) {
                 break;
             }
 #endif
+#endif
+
             default:
                 break;
             }
index 29488b57c7ee83baf24afcdd8140abe9e81c6e8d..aa7e8334a97c585dbbeee0c239aa2f6281938514 100644 (file)
@@ -644,6 +644,7 @@ foundBest:
     return wordsFound;
 }
 
+#if !UCONFIG_NO_NORMALIZATION
 /*
  ******************************************************************
  * CjkBreakEngine
@@ -933,6 +934,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *text,
     utext_close(&normalizedText);
     return numBreaks;
 }
+#endif
 
 U_NAMESPACE_END
 
index 6b179e19d9e8b1fec491cc2df20006c74c64517d..09cc48ea8c611aaefe756139228a9a753d3de61a 100644 (file)
@@ -186,6 +186,8 @@ class ThaiBreakEngine : public DictionaryBreakEngine {
 
 };
 
+#if !UCONFIG_NO_NORMALIZATION
+
 /*******************************************************************
  * CjkBreakEngine
  */
@@ -247,6 +249,8 @@ class CjkBreakEngine : public DictionaryBreakEngine {
 
 };
 
+#endif
+
 /******************************************************************* 
  * KhmerBreakEngine 
  */ 
index 1971751dede108685108da493a22642fad4dd787..cc845425c337d8f497b79def240e1b8b0f16a0d9 100644 (file)
@@ -15,6 +15,8 @@
 #include "unicode/udata.h"
 #include "cmemory.h"
 
+#if !UCONFIG_NO_BREAK_ITERATION
+
 U_NAMESPACE_BEGIN
 
 #ifndef CYGWINMSVC /* On Cygwin/MSVC, the error redefinition of symbols occurs.*/
@@ -223,4 +225,4 @@ udict_swap(const UDataSwapper *ds, const void *inData, int32_t length,
     }
     return headerSize + size;
 }
-
+#endif
index 8b1ad41d11f06e80d0394f65a042f7910548d952..8677a03d9d1457821116f740f0d45eff7b593bcd 100644 (file)
@@ -47,6 +47,7 @@ format.h
 fpositer.h
 gregocal.h
 idna.h
+listformatter.h
 locdspnm.h
 locid.h
 measfmt.h
index 617d960311b45c62a4d9ada95062cbaeedc846e4..07ad718551f1675fd1b2a2f1dc6a78867e1fdbdd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *******************************************************************************
  *
- *   Copyright (C) 2003-2011, International Business Machines
+ *   Copyright (C) 2003-2012, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *
  *******************************************************************************
@@ -1524,6 +1524,15 @@ void TestIDNA::TestCompareReferenceImpl(){
     UChar src [2] = {0,0};
     int32_t srcLen = 0;
 
+    // data even OK?
+    {
+      UErrorCode dataStatus = U_ZERO_ERROR;
+      loadTestData(dataStatus);
+      if(U_FAILURE(dataStatus)) {
+        errln("Couldn't load test data: %s\n", u_errorName(dataStatus)); // save us from thousands and thousands of errors
+        return;
+      }
+    }
 
     for (int32_t i = 0; i <= 0x10FFFF; i++){
         if (quick == TRUE && i > 0x0FFF){
index 82628a46dda53328157c34a2a0b0221d20331643..b95fb2404b10a23d9b1328188f4036857f89fe44 100644 (file)
@@ -97,6 +97,8 @@ static UDataInfo dataInfo = {
     { 0, 0, 0, 0 }                  /* data version */
 };
 
+#if !UCONFIG_NO_BREAK_ITERATION
+
 // A wrapper for both BytesTrieBuilder and UCharsTrieBuilder.
 // may want to put this somewhere in ICU, as it could be useful outside
 // of this tool?
@@ -199,6 +201,7 @@ public:
         return (int32_t)(transformType | transformConstant); 
     }
 };
+#endif
 
 static const UChar LINEFEED_CHARACTER = 0x000A;
 static const UChar CARRIAGE_RETURN_CHARACTER = 0x000D;
@@ -274,19 +277,21 @@ int  main(int argc, char **argv) {
     IcuToolErrorCode status("gendict/main()");
 
 #if UCONFIG_NO_BREAK_ITERATION || UCONFIG_NO_FILE_IO
+    const char* outDir=NULL;
 
     UNewDataMemory *pData;
     char msg[1024];
+    UErrorCode tempstatus = U_ZERO_ERROR;
 
     /* write message with just the name */ // potential for a buffer overflow here...
     sprintf(msg, "gendict writes dummy %s because of UCONFIG_NO_BREAK_ITERATION and/or UCONFIG_NO_FILE_IO, see uconfig.h", outFileName);
     fprintf(stderr, "%s\n", msg);
 
     /* write the dummy data file */
-    pData = udata_create(outDir, NULL, outFileName, &dataInfo, NULL, &status);
+    pData = udata_create(outDir, NULL, outFileName, &dataInfo, NULL, &tempstatus);
     udata_writeBlock(pData, msg, strlen(msg));
-    udata_finish(pData, &status);
-    return (int)status;
+    udata_finish(pData, &tempstatus);
+    return (int)tempstatus;
 
 #else
     //  Read in the dictionary source file