gecko-dev/intl/icu-patches/genrb-omitCollationRules.diff
Jeff Walden 013fc50cd5 Bug 924839 - Update our embedded ICU to 52.1, plus a very few local patches. r=lots of people, see subsequent lines in this commit message for the original subcomponents (merged together for landing), and the original bug for the original patch divisions
Bug 924839 - Remove a patch already part of ICU 52.1.  See http://bugs.icu-project.org/trac/ticket/10283 but also note the relevant code was removed completely upstream.  r=glandium
* * *
Bug 924839 - Remove another patch already part of ICU 52.1.  See http://bugs.icu-project.org/trac/ticket/10290 for that.  r=gaston
* * *
Bug 924839 - Remove another patch already in ICU 52.1.  See http://bugs.icu-project.org/trac/ticket/10045 for more.  r=Norbert
* * *
Bug 924839 - Remove another patch already applied upstream.  See http://bugs.icu-project.org/trac/changeset/32937 for more.  r=gaston
* * *
Bug 924839 - Update the ICU update script to update to 52.1, *without* applying any of our local patches.  r=glandium
* * *
Bug 924839 - Make the ICU update script only do updating within intl/icu/source and nowhere else.  r=glandium
* * *
Bug 924839 - Implement the changes that would be made by |cd intl/; ./update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-52-1/;|, run with the prior changesets' changes made (thus not applying any of our local patches).  These changes don't actually work without subsequent adjustments, but this provides a codebase upon which those adjustments can be made, for the purpose of generating local patches to be kept in intl/icu-patches/.  rs=the-usual-suspects
* * *
Bug 924839 - Update the bug 899722 local patch to make runConfigureICU not override CC/CXX on BSD systems.  r=gaston
* * *
Bug 924839 - Update the bug 724533 patch that makes ICU builds with MozillaBuild on Windows.  r=glandium
* * *
Bug 924839 - Import an upstream patch fixing the genrb tool to properly handle the -R (--omitCollationRules) option.  See http://bugs.icu-project.org/trac/ticket/10043 for the original bug report and a link to the ultimate upstream landing.  r=Norbert
* * *
Bug 924839 - Import the upstream fix for http://bugs.icu-project.org/trac/ticket/10486 so that ICU with -DU_USING_ICU_NAMESPACE=0 will compile on Windows.  r=Norbert
* * *
Bug 924839 - Adjust the update script to update ICU, then to apply all local patches (rather than skipping the second step).  Thus if the update script is properly run, now, the final result should be no changes at all to the tree.  NOT REVIEWED YET
* * *
Bug 924839 - Update jstests that depend on CLDR locale data to match CLDR 24.  r=Norbert
2013-11-12 16:23:48 -08:00

137 lines
4.9 KiB
Diff

diff --git a/intl/icu/source/tools/genrb/genrb.c b/intl/icu/source/tools/genrb/genrb.c
--- a/intl/icu/source/tools/genrb/genrb.c
+++ b/intl/icu/source/tools/genrb/genrb.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2012, International Business Machines
+* Copyright (C) 1998-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -280,7 +280,7 @@
}
}
- initParser(options[NO_COLLATION_RULES].doesOccur);
+ initParser();
/*added by Jing*/
if(options[LANGUAGE].doesOccur) {
@@ -557,7 +557,8 @@
printf("autodetected encoding %s\n", cp);
}
/* Parse the data into an SRBRoot */
- data = parse(ucbuf, inputDir, outputDir, !omitBinaryCollation, status);
+ data = parse(ucbuf, inputDir, outputDir,
+ !omitBinaryCollation, options[NO_COLLATION_RULES].doesOccur, status);
if (data == NULL || U_FAILURE(*status)) {
fprintf(stderr, "couldn't parse the file %s. Error:%s\n", filename,u_errorName(*status));
diff --git a/intl/icu/source/tools/genrb/parse.cpp b/intl/icu/source/tools/genrb/parse.cpp
--- a/intl/icu/source/tools/genrb/parse.cpp
+++ b/intl/icu/source/tools/genrb/parse.cpp
@@ -85,10 +85,9 @@
const char *outputdir;
uint32_t outputdirLength;
UBool makeBinaryCollation;
+ UBool omitCollationRules;
} ParseState;
-static UBool gOmitCollationRules = FALSE;
-
typedef struct SResource *
ParseResourceFunction(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status);
@@ -323,7 +322,7 @@
}
uprv_strcat(filename, cs);
- if(gOmitCollationRules) {
+ if(state->omitCollationRules) {
return res_none();
}
@@ -771,7 +770,7 @@
}
/* Parse the data into an SRBRoot */
- data = parse(ucbuf, genrbdata->inputDir, genrbdata->outputDir, FALSE, status);
+ data = parse(ucbuf, genrbdata->inputDir, genrbdata->outputDir, FALSE, FALSE, status);
root = data->fRoot;
collations = resLookup(root, "collations");
@@ -1007,7 +1006,7 @@
#endif
/* in order to achieve smaller data files, we can direct genrb */
/* to omit collation rules */
- if(gOmitCollationRules) {
+ if(state->omitCollationRules) {
bundle_closeString(state->bundle, member);
} else {
table_add(result, member, line, status);
@@ -1839,7 +1838,7 @@
{"reserved", NULL, NULL}
};
-void initParser(UBool omitCollationRules)
+void initParser()
{
U_STRING_INIT(k_type_string, "string", 6);
U_STRING_INIT(k_type_binary, "binary", 6);
@@ -1858,8 +1857,6 @@
U_STRING_INIT(k_type_plugin_collation, "process(collation)", 18);
U_STRING_INIT(k_type_plugin_transliterator, "process(transliterator)", 23);
U_STRING_INIT(k_type_plugin_dependency, "process(dependency)", 19);
-
- gOmitCollationRules = omitCollationRules;
}
static inline UBool isTable(enum EResourceType type) {
@@ -2039,8 +2036,8 @@
/* parse the top-level resource */
struct SRBRoot *
-parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UBool makeBinaryCollation,
- UErrorCode *status)
+parse(UCHARBUF *buf, const char *inputDir, const char *outputDir,
+ UBool makeBinaryCollation, UBool omitCollationRules, UErrorCode *status)
{
struct UString *tokenValue;
struct UString comment;
@@ -2064,6 +2061,7 @@
state.outputdir = outputDir;
state.outputdirLength = (state.outputdir != NULL) ? (uint32_t)uprv_strlen(state.outputdir) : 0;
state.makeBinaryCollation = makeBinaryCollation;
+ state.omitCollationRules = omitCollationRules;
ustr_init(&comment);
expect(&state, TOK_STRING, &tokenValue, &comment, NULL, status);
diff --git a/intl/icu/source/tools/genrb/parse.h b/intl/icu/source/tools/genrb/parse.h
--- a/intl/icu/source/tools/genrb/parse.h
+++ b/intl/icu/source/tools/genrb/parse.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2011, International Business Machines
+* Copyright (C) 1998-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -24,11 +24,11 @@
U_CDECL_BEGIN
/* One time parser initalisation */
-void initParser(UBool omitCollationRules);
+void initParser();
/* Parse a ResourceBundle text file */
struct SRBRoot* parse(UCHARBUF *buf, const char* inputDir, const char* outputDir,
- UBool omitBinaryCollation, UErrorCode *status);
+ UBool makeBinaryCollation, UBool omitCollationRules, UErrorCode *status);
U_CDECL_END