From 826971da3ef29f6034fc6a4786f88878a56c58e3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Dec 2019 18:25:29 +0000 Subject: icu-65.1, including linking upmendex with -lpthread if available git-svn-id: svn://tug.org/texlive/trunk@53103 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/icu/icu-src/source/tools/ctestfw/ctest.c | 21 +- .../icu-src/source/tools/ctestfw/ctestfw.vcxproj | 130 +++------- .../icu-src/source/tools/escapesrc/escapesrc.cpp | 17 +- .../icu/icu-src/source/tools/genbrk/genbrk.cpp | 6 +- .../icu/icu-src/source/tools/genbrk/genbrk.vcxproj | 198 +++------------ .../icu/icu-src/source/tools/genccode/genccode.c | 15 +- .../icu-src/source/tools/genccode/genccode.vcxproj | 194 +++----------- .../icu/icu-src/source/tools/gencfu/gencfu.cpp | 2 +- .../icu/icu-src/source/tools/gencfu/gencfu.vcxproj | 187 +++----------- .../icu/icu-src/source/tools/gencmn/gencmn.vcxproj | 198 +++------------ .../icu/icu-src/source/tools/gencnval/gencnval.c | 144 +++++------ .../icu-src/source/tools/gencnval/gencnval.vcxproj | 198 +++------------ .../icu-src/source/tools/gendict/gendict.vcxproj | 198 +++------------ .../icu-src/source/tools/gennorm2/gennorm2.vcxproj | 151 +++-------- .../icu/icu-src/source/tools/genrb/Makefile.in | 2 +- .../libs/icu/icu-src/source/tools/genrb/derb.cpp | 2 +- .../icu/icu-src/source/tools/genrb/derb.vcxproj | 210 +++------------ .../icu/icu-src/source/tools/genrb/filterrb.cpp | 239 +++++++++++++++++ .../libs/icu/icu-src/source/tools/genrb/filterrb.h | 180 +++++++++++++ .../libs/icu/icu-src/source/tools/genrb/genrb.cpp | 182 +++++++------ .../icu/icu-src/source/tools/genrb/genrb.vcxproj | 198 +++------------ .../source/tools/genrb/genrb.vcxproj.filters | 6 + .../libs/icu/icu-src/source/tools/genrb/parse.cpp | 112 ++++---- .../icu/icu-src/source/tools/genrb/reslist.cpp | 126 +++++++-- .../libs/icu/icu-src/source/tools/genrb/reslist.h | 30 ++- .../libs/icu/icu-src/source/tools/genrb/rle.c | 4 +- .../libs/icu/icu-src/source/tools/genrb/ustr.h | 8 +- .../libs/icu/icu-src/source/tools/genren/README | 6 +- .../icu/icu-src/source/tools/gensprep/gensprep.c | 3 + .../icu-src/source/tools/gensprep/gensprep.vcxproj | 196 +++----------- .../libs/icu/icu-src/source/tools/gensprep/store.c | 3 +- .../icu-src/source/tools/gentest/gentest.vcxproj | 177 ++----------- .../icu-src/source/tools/icu-file-utf8-check.py | 22 +- .../icu/icu-src/source/tools/icuinfo/icuinfo.cpp | 10 + .../icu-src/source/tools/icuinfo/icuinfo.vcxproj | 130 +++------- .../icu-src/source/tools/icuinfo/testplug.vcxproj | 201 +++------------ .../icu/icu-src/source/tools/icupkg/icupkg.vcxproj | 132 +++------- .../icu/icu-src/source/tools/makeconv/gencnvex.c | 7 +- .../icu/icu-src/source/tools/makeconv/makeconv.cpp | 14 +- .../icu-src/source/tools/makeconv/makeconv.vcxproj | 138 +++------- .../icu/icu-src/source/tools/pkgdata/pkgdata.cpp | 112 ++++---- .../icu-src/source/tools/pkgdata/pkgdata.vcxproj | 152 +++-------- .../icu-src/source/tools/toolutil/filetools.cpp | 2 +- .../icu/icu-src/source/tools/toolutil/pkg_genc.cpp | 282 +++++++++++++++------ .../icu/icu-src/source/tools/toolutil/pkg_genc.h | 25 +- .../icu-src/source/tools/toolutil/pkg_gencmn.cpp | 8 +- .../icu/icu-src/source/tools/toolutil/pkgitems.cpp | 3 +- .../icu/icu-src/source/tools/toolutil/swapimpl.cpp | 105 ++++++++ .../icu/icu-src/source/tools/toolutil/toolutil.cpp | 4 +- .../icu-src/source/tools/toolutil/toolutil.vcxproj | 194 +++++++++----- .../icu/icu-src/source/tools/toolutil/ucbuf.cpp | 4 +- .../libs/icu/icu-src/source/tools/toolutil/ucbuf.h | 4 +- .../icu/icu-src/source/tools/toolutil/ucmstate.cpp | 3 +- .../icu-src/source/tools/toolutil/xmlparser.cpp | 2 +- .../icu/icu-src/source/tools/tzcode/Makefile.in | 52 ++-- .../icu-src/source/tools/tzcode/icuzdump.vcxproj | 2 - .../libs/icu/icu-src/source/tools/tzcode/icuzones | 98 ------- 57 files changed, 1980 insertions(+), 3069 deletions(-) create mode 100644 Build/source/libs/icu/icu-src/source/tools/genrb/filterrb.cpp create mode 100644 Build/source/libs/icu/icu-src/source/tools/genrb/filterrb.h (limited to 'Build/source/libs/icu/icu-src/source/tools') diff --git a/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctest.c b/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctest.c index 6b0ee9633b2..f0f665428e4 100644 --- a/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctest.c +++ b/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctest.c @@ -420,7 +420,7 @@ static void iterateTestsWithLevel ( const TestNode* root, } } else { /* put -- out at 30 sp. */ - int spaces = FLAG_INDENT-(strlen(root->name)+depth); + int spaces = FLAG_INDENT - ((int)strlen(root->name) + depth); if(spaces<0) spaces=0; log_testinfo(" %*s[OK] ", spaces,"---"); } @@ -891,18 +891,22 @@ log_data_err(const char* pattern, ...) static int traceFnNestingDepth = 0; U_CDECL_BEGIN static void U_CALLCONV TraceEntry(const void *context, int32_t fnNumber) { + (void)context; // suppress compiler warnings about unused variable char buf[500]; - utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() enter.\n", utrace_functionName(fnNumber)); buf[sizeof(buf)-1]=0; + utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() enter.\n", utrace_functionName(fnNumber)); + buf[sizeof(buf)-1]=0; fputs(buf, stdout); traceFnNestingDepth++; } -static void U_CALLCONV TraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) { char buf[500]; - +static void U_CALLCONV TraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) { + (void)context; // suppress compiler warnings about unused variable + char buf[500]; if (traceFnNestingDepth>0) { traceFnNestingDepth--; } - utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() ", utrace_functionName(fnNumber)); buf[sizeof(buf)-1]=0; + utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() ", utrace_functionName(fnNumber)); + buf[sizeof(buf)-1]=0; fputs(buf, stdout); utrace_vformat(buf, sizeof(buf), traceFnNestingDepth*3, fmt, args); buf[sizeof(buf)-1]=0; @@ -912,6 +916,10 @@ static void U_CALLCONV TraceExit(const void *context, int32_t fnNumber, const ch static void U_CALLCONV TraceData(const void *context, int32_t fnNumber, int32_t level, const char *fmt, va_list args) { + // suppress compiler warnings about unused variables + (void)context; + (void)fnNumber; + (void)level; char buf[500]; utrace_vformat(buf, sizeof(buf), traceFnNestingDepth*3, fmt, args); buf[sizeof(buf)-1]=0; @@ -920,6 +928,7 @@ static void U_CALLCONV TraceData(const void *context, int32_t fnNumber, } static void *U_CALLCONV ctest_libMalloc(const void *context, size_t size) { + (void)context; // suppress compiler warnings about unused variable /*if (VERBOSITY) { printf("Allocated %ld\n", (long)size); }*/ @@ -929,6 +938,7 @@ static void *U_CALLCONV ctest_libMalloc(const void *context, size_t size) { return malloc(size); } static void *U_CALLCONV ctest_libRealloc(const void *context, void *mem, size_t size) { + (void)context; // suppress compiler warnings about unused variable /*if (VERBOSITY) { printf("Reallocated %ld\n", (long)size); }*/ @@ -939,6 +949,7 @@ static void *U_CALLCONV ctest_libRealloc(const void *context, void *mem, size_t return realloc(mem, size); } static void U_CALLCONV ctest_libFree(const void *context, void *mem) { + (void)context; // suppress compiler warnings about unused variable free(mem); } diff --git a/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctestfw.vcxproj b/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctestfw.vcxproj index baabf4f3814..b3b1895e7de 100644 --- a/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctestfw.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/ctestfw/ctestfw.vcxproj @@ -1,17 +1,16 @@  - - - {ECA6B435-B4FA-4F9F-BF95-F451D078FC47} - DynamicLibrary false MultiByte + + + @@ -34,128 +33,59 @@ <_ProjectFileVersion>10.0.30319.1 - .\..\..\..\lib\ - .\x86\Release\ - false - .\..\..\..\lib\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false + + $(OutDir)/icutest.tlb + ..\..\..\include;..\..\common;..\toolutil;%(AdditionalIncludeDirectories) T_CTEST_IMPLEMENTATION;%(PreprocessorDefinitions) true Level3 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\..\lib\icutest.tlb - - - true - MultiThreadedDLL - true - .\x86\Release/icutest.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Default + $(OutDir)/icutest.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/icutest.pdb - ..\..\..\bin\icutest63.dll - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\..\..\..\lib\icutest.pdb - UseLinkTimeCodeGeneration - false - - - .\..\..\..\lib\icutest.lib + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - .\..\..\..\lib\icutestd.tlb - + + - MultiThreadedDebugDLL - .\x86\Debug/icutest.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - EditAndContinue - Default + MultiThreadedDebugDLL - ..\..\..\bin\icutest63d.dll + ..\..\..\$(IcuBinOutputDir)\icutest65d.exe + .\..\..\..\$(IcuLibOutputDir)\icutestd.pdb + .\..\..\..\$(IcuLibOutputDir)\icutestd.lib icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\..\..\..\lib\icutestd.pdb - false - - - .\..\..\..\lib\icutestd.lib - - - .\..\..\..\lib64\icutest.tlb - + + - true MultiThreadedDLL true - .\x64\Release/icutest.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Default - ..\..\..\bin64\icutest63.dll + ..\..\..\$(IcuBinOutputDir)\icutest65.exe + .\..\..\..\$(IcuLibOutputDir)\icutest.pdb + .\..\..\..\$(IcuLibOutputDir)\icutest.lib icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\..\..\..\lib64\icutest.pdb - UseLinkTimeCodeGeneration - .\..\..\..\lib64\icutest.lib - - - - - .\..\..\..\lib64\icutestd.tlb - - - MultiThreadedDebugDLL - .\x64\Debug/icutest.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - ProgramDatabase - Default - - - ..\..\..\bin64\icutest63d.dll - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\..\..\..\lib64\icutestd.pdb - .\..\..\..\lib64\icutestd.lib diff --git a/Build/source/libs/icu/icu-src/source/tools/escapesrc/escapesrc.cpp b/Build/source/libs/icu/icu-src/source/tools/escapesrc/escapesrc.cpp index c90dafa4e01..ce14022bfc1 100644 --- a/Build/source/libs/icu/icu-src/source/tools/escapesrc/escapesrc.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/escapesrc/escapesrc.cpp @@ -327,6 +327,9 @@ bool fixLine(int /*no*/, std::string &linestr) { // start from the end and find all u" cases size_t pos = len = linestr.size(); + if(len>INT32_MAX/2) { + return true; + } while((pos>0) && (pos = linestr.rfind("u\"", pos)) != std::string::npos) { //printf("found doublequote at %d\n", pos); if(fixAt(linestr, pos)) return true; @@ -391,15 +394,19 @@ int convert(const std::string &infile, const std::string &outfile) { while( getline( inf, linestr)) { no++; if(fixLine(no, linestr)) { - outf.close(); - fprintf(stderr, "%s:%d: Fixup failed by %s\n", infile.c_str(), no, prog.c_str()); - cleanup(outfile); - return 1; + goto fail; } outf << linestr << '\n'; } - return 0; + if(inf.eof()) { + return 0; + } +fail: + outf.close(); + fprintf(stderr, "%s:%d: Fixup failed by %s\n", infile.c_str(), no, prog.c_str()); + cleanup(outfile); + return 1; } /** diff --git a/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.cpp b/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.cpp index 0a4ec3c9ae6..38df3ee969c 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.cpp @@ -262,7 +262,7 @@ int main(int argc, char **argv) { if (status != U_BUFFER_OVERFLOW_ERROR) { fprintf(stderr, "ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status)); exit(status); - }; + } status = U_ZERO_ERROR; UChar *ruleSourceU = new UChar[destCap+1]; @@ -275,7 +275,7 @@ int main(int argc, char **argv) { if (U_FAILURE(status)) { fprintf(stderr, "ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status)); exit(status); - }; + } ucnv_close(conv); @@ -296,7 +296,7 @@ int main(int argc, char **argv) { fprintf(stderr, "createRuleBasedBreakIterator: ICU Error \"%s\" at line %d, column %d\n", u_errorName(status), (int)parseError.line, (int)parseError.offset); exit(status); - }; + } // diff --git a/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.vcxproj b/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.vcxproj index b8aa0ab6998..dff44bc5e27 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/genbrk/genbrk.vcxproj @@ -1,17 +1,16 @@  - - - {C2BE5000-7501-4E87-9724-B8D82494FAE6} - Application false MultiByte + + + @@ -34,195 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - .\x86\Release/genbrk.tlb + $(OutDir)/genbrk.tlb - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - false - true - .\x86\Release/genbrk.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + false + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/genbrk.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/genbrk.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/genbrk.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/genbrk.pdb Console - false - - + $(OutDir)/genbrk.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/genbrk.tlb - + + + - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - false - true - .\x86\Debug/genbrk.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/genbrk.exe - true icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/genbrk.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/genbrk.tlb - + + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - false - true - .\x64\Release/genbrk.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/genbrk.exe - true icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/genbrk.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/genbrk.tlb - - - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - false - true - .\x64\Debug/genbrk.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/genbrk.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/genbrk.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.c b/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.c index d35b5890105..91e94d7f518 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.c +++ b/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.c @@ -63,6 +63,7 @@ enum { kOptHelpH = 0, kOptHelpQuestionMark, kOptDestDir, + kOptQuiet, kOptName, kOptEntryPoint, #ifdef CAN_GENERATE_OBJECTS @@ -77,6 +78,7 @@ static UOption options[]={ /*0*/UOPTION_HELP_H, UOPTION_HELP_QUESTION_MARK, UOPTION_DESTDIR, + UOPTION_QUIET, UOPTION_DEF("name", 'n', UOPT_REQUIRES_ARG), UOPTION_DEF("entrypoint", 'e', UOPT_REQUIRES_ARG), #ifdef CAN_GENERATE_OBJECTS @@ -116,6 +118,7 @@ main(int argc, char* argv[]) { "options:\n" "\t-h or -? or --help this usage text\n" "\t-d or --destdir destination directory, followed by the path\n" + "\t-q or --quiet do not display warnings and progress\n" "\t-n or --name symbol prefix, followed by the prefix\n" "\t-e or --entrypoint entry point name, followed by the name (_dat will be appended)\n" "\t-r or --revision Specify a version\n" @@ -159,6 +162,9 @@ main(int argc, char* argv[]) { writeCode = CALL_WRITECCODE; /* TODO: remove writeCode=&writeCCode; */ } + if (options[kOptQuiet].doesOccur) { + verbose = FALSE; + } while(--argc) { filename=getLongPathname(argv[argc]); if (verbose) { @@ -170,13 +176,15 @@ main(int argc, char* argv[]) { writeCCode(filename, options[kOptDestDir].value, options[kOptName].doesOccur ? options[kOptName].value : NULL, options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL, - NULL); + NULL, + 0); break; case CALL_WRITEASSEMBLY: writeAssemblyCode(filename, options[kOptDestDir].value, options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL, options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL, - NULL); + NULL, + 0); break; #ifdef CAN_GENERATE_OBJECTS case CALL_WRITEOBJECT: @@ -184,7 +192,8 @@ main(int argc, char* argv[]) { options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL, options[kOptMatchArch].doesOccur ? options[kOptMatchArch].value : NULL, options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL, - NULL); + NULL, + 0); break; #endif default: diff --git a/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.vcxproj b/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.vcxproj index e7dc0e535c8..f3195147b15 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/genccode/genccode.vcxproj @@ -1,17 +1,16 @@  - - - {FDD3C4F2-9805-44EB-9A77-BC1C1C95B547} - Application false MultiByte + + + @@ -34,191 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - .\x86\Release/genccode.tlb + $(OutDir)/genccode.tlb - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - .\x86\Release/genccode.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + false + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/genccode.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/genccode.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/genccode.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/genccode.pdb Console - false - - + $(OutDir)/genccode.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/genccode.tlb - + + + - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - .\x86\Debug/genccode.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/genccode.exe - true icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/genccode.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/genccode.tlb - + + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - true - .\x64\Release/genccode.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/genccode.exe - true icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/genccode.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/genccode.tlb - - - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - .\x64\Debug/genccode.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/genccode.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/genccode.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.cpp b/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.cpp index 1ac9ad3fd8a..9bc62bdc8e9 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.cpp @@ -236,7 +236,7 @@ int main(int argc, char **argv) { fprintf(stderr, "gencfu: uspoof_openFromSource error \"%s\" at file %s, line %d, column %d\n", u_errorName(status), confFileName, (int)parseError.line, (int)parseError.offset); exit(status); - }; + } // diff --git a/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.vcxproj b/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.vcxproj index fbae8f54fdc..0627f02210d 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/gencfu/gencfu.vcxproj @@ -1,18 +1,16 @@  - - - {691EE0C0-DC57-4A48-8AEE-8ED75EB3A057} - Win32Proj - Application false MultiByte + + + @@ -35,175 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Debug\ - .\x86\Debug\ - true - .\x86\Release\ - .\x86\Release\ - false - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + + + $(OutDir)\gencfu.tlb + - Disabled - ..\..\common;..\..\i18n;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - true - false - - - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ - true Level3 - EditAndContinue Default - /utf-8 %(AdditionalOptions) - true + false + ..\..\common;..\..\i18n;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)\gencfu.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\gencfu.pdb - .\x86\Debug\gencfu.exe - true - icuucd.lib;icuind.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true Console + $(OutDir)\gencfu.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) + + + - ..\..\common;..\..\i18n;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - false - MultiThreadedDLL - true - false - true - - - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ - Level3 - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true + true + MultiThreadedDebugDLL - .\x86\Release\gencfu.exe - true - true - icuuc.lib;icuin.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - Console - false - - + icuucd.lib;icuind.lib;icutud.lib;%(AdditionalDependencies) - - - copy "$(TargetPath)" ..\..\..\bin64%3b - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/gencfu.tlb - + + - ..\..\common;..\..\i18n;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - false - true - .\x64\Release/gencfu.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/gencfu.exe - true icuuc.lib;icuin.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/gencfu.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64%3b - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/gencfu.tlb - - - Disabled - ..\..\common;..\..\i18n;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - false - true - .\x64\Debug/gencfu.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/gencfu.exe - true - icuucd.lib;icuind.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/gencfu.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/gencmn/gencmn.vcxproj b/Build/source/libs/icu/icu-src/source/tools/gencmn/gencmn.vcxproj index 87aeef33621..dffc4199932 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gencmn/gencmn.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/gencmn/gencmn.vcxproj @@ -1,17 +1,16 @@  - - - {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F} - Application false MultiByte + + + @@ -34,195 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - .\x86\Release/gencmn.tlb + $(OutDir)/gencmn.tlb - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - true - .\x86\Release/gencmn.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + true + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/gencmn.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/gencmn.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/gencmn.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/gencmn.pdb Console - false - - + $(OutDir)/gencmn.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/gencmn.tlb - + + + - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x86\Debug/gencmn.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/gencmn.exe - true icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/gencmn.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/gencmn.tlb - + + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - true - true - .\x64\Release/gencmn.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/gencmn.exe - true icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/gencmn.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/gencmn.tlb - - - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x64\Debug/gencmn.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/gencmn.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/gencmn.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.c b/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.c index 04ad747e077..82cf65d6a3a 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.c +++ b/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.c @@ -263,23 +263,22 @@ main(int argc, char* argv[]) { quiet = TRUE; } - if(argc>=2) { - path=argv[1]; + if (argc >= 2) { + path = argv[1]; } else { - path=options[SOURCEDIR].value; - if(path!=NULL && *path!=0) { - char *end; - - uprv_strcpy(pathBuf, path); - end = uprv_strchr(pathBuf, 0); - if(*(end-1)!=U_FILE_SEP_CHAR) { - *(end++)=U_FILE_SEP_CHAR; - } - uprv_strcpy(end, "convrtrs.txt"); - path=pathBuf; - } else { - path = "convrtrs.txt"; + path = "convrtrs.txt"; + } + + const char* sourcedir = options[SOURCEDIR].value; + if (sourcedir != NULL && *sourcedir != 0) { + char *end; + uprv_strcpy(pathBuf, sourcedir); + end = uprv_strchr(pathBuf, 0); + if(*(end-1)!=U_FILE_SEP_CHAR) { + *(end++)=U_FILE_SEP_CHAR; } + uprv_strcpy(end, path); + path = pathBuf; } uprv_memset(stringStore, 0, sizeof(stringStore)); @@ -583,6 +582,7 @@ addTaggedAlias(uint16_t tag, const char *alias, uint16_t converter) { static void addOfficialTaggedStandards(char *line, int32_t lineLen) { + (void) lineLen; // suppress compiler warnings about unused variable char *atag; char *endTagExp; char *tag; @@ -854,62 +854,64 @@ resolveAliases(uint16_t *uniqueAliasArr, uint16_t *uniqueAliasToConverterArr, ui uint16_t currConvNum, oldConvNum; const char *lastName; - resolveAliasToConverter(knownAliases[0], &oldTagNum, &currConvNum); - uniqueAliasToConverterArr[uniqueAliasIdx] = currConvNum; - oldConvNum = currConvNum; - uniqueAliasArr[uniqueAliasIdx] = knownAliases[0] + aliasOffset; - uniqueAliasIdx++; - lastName = GET_ALIAS_STR(knownAliases[0]); - - for (idx = 1; idx < knownAliasesCount; idx++) { - resolveAliasToConverter(knownAliases[idx], &currTagNum, &currConvNum); - if (ucnv_compareNames(lastName, GET_ALIAS_STR(knownAliases[idx])) == 0) { - /* duplicate found */ - if ((currTagNum < oldTagNum && currTagNum >= UCNV_NUM_RESERVED_TAGS) - || oldTagNum == 0) { - oldTagNum = currTagNum; - uniqueAliasToConverterArr[uniqueAliasIdx - 1] = currConvNum; - uniqueAliasArr[uniqueAliasIdx - 1] = knownAliases[idx] + aliasOffset; - if (verbose) { - printf("using %s instead of %s -> %s", - GET_ALIAS_STR(knownAliases[idx]), - lastName, - GET_ALIAS_STR(converters[currConvNum].converter)); - if (oldConvNum != currConvNum) { - printf(" (alias conflict)"); - } - puts(""); - } - } - else { - /* else ignore it */ - if (verbose) { - printf("folding %s into %s -> %s", - GET_ALIAS_STR(knownAliases[idx]), - lastName, - GET_ALIAS_STR(converters[oldConvNum].converter)); - if (oldConvNum != currConvNum) { - printf(" (alias conflict)"); - } - puts(""); - } - } - if (oldConvNum != currConvNum) { - uniqueAliasToConverterArr[uniqueAliasIdx - 1] |= UCNV_AMBIGUOUS_ALIAS_MAP_BIT; - } - } - else { - uniqueAliasToConverterArr[uniqueAliasIdx] = currConvNum; - oldConvNum = currConvNum; - uniqueAliasArr[uniqueAliasIdx] = knownAliases[idx] + aliasOffset; - uniqueAliasIdx++; - lastName = GET_ALIAS_STR(knownAliases[idx]); - oldTagNum = currTagNum; - /*printf("%s -> %s\n", GET_ALIAS_STR(knownAliases[idx]), GET_ALIAS_STR(converters[currConvNum].converter));*/ - } - if (uprv_strchr(GET_ALIAS_STR(converters[currConvNum].converter), UCNV_OPTION_SEP_CHAR) != NULL) { - uniqueAliasToConverterArr[uniqueAliasIdx-1] |= UCNV_CONTAINS_OPTION_BIT; - } + if (knownAliasesCount != 0) { + resolveAliasToConverter(knownAliases[0], &oldTagNum, &currConvNum); + uniqueAliasToConverterArr[uniqueAliasIdx] = currConvNum; + oldConvNum = currConvNum; + uniqueAliasArr[uniqueAliasIdx] = knownAliases[0] + aliasOffset; + uniqueAliasIdx++; + lastName = GET_ALIAS_STR(knownAliases[0]); + + for (idx = 1; idx < knownAliasesCount; idx++) { + resolveAliasToConverter(knownAliases[idx], &currTagNum, &currConvNum); + if (ucnv_compareNames(lastName, GET_ALIAS_STR(knownAliases[idx])) == 0) { + /* duplicate found */ + if ((currTagNum < oldTagNum && currTagNum >= UCNV_NUM_RESERVED_TAGS) + || oldTagNum == 0) { + oldTagNum = currTagNum; + uniqueAliasToConverterArr[uniqueAliasIdx - 1] = currConvNum; + uniqueAliasArr[uniqueAliasIdx - 1] = knownAliases[idx] + aliasOffset; + if (verbose) { + printf("using %s instead of %s -> %s", + GET_ALIAS_STR(knownAliases[idx]), + lastName, + GET_ALIAS_STR(converters[currConvNum].converter)); + if (oldConvNum != currConvNum) { + printf(" (alias conflict)"); + } + puts(""); + } + } + else { + /* else ignore it */ + if (verbose) { + printf("folding %s into %s -> %s", + GET_ALIAS_STR(knownAliases[idx]), + lastName, + GET_ALIAS_STR(converters[oldConvNum].converter)); + if (oldConvNum != currConvNum) { + printf(" (alias conflict)"); + } + puts(""); + } + } + if (oldConvNum != currConvNum) { + uniqueAliasToConverterArr[uniqueAliasIdx - 1] |= UCNV_AMBIGUOUS_ALIAS_MAP_BIT; + } + } + else { + uniqueAliasToConverterArr[uniqueAliasIdx] = currConvNum; + oldConvNum = currConvNum; + uniqueAliasArr[uniqueAliasIdx] = knownAliases[idx] + aliasOffset; + uniqueAliasIdx++; + lastName = GET_ALIAS_STR(knownAliases[idx]); + oldTagNum = currTagNum; + /*printf("%s -> %s\n", GET_ALIAS_STR(knownAliases[idx]), GET_ALIAS_STR(converters[currConvNum].converter));*/ + } + if (uprv_strchr(GET_ALIAS_STR(converters[currConvNum].converter), UCNV_OPTION_SEP_CHAR) != NULL) { + uniqueAliasToConverterArr[uniqueAliasIdx-1] |= UCNV_CONTAINS_OPTION_BIT; + } + } } return uniqueAliasIdx; } diff --git a/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.vcxproj b/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.vcxproj index d2becad2b90..57b5f95f881 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/gencnval/gencnval.vcxproj @@ -1,17 +1,16 @@  - - - {8B41752B-5A52-41E4-B7E0-07921C0CC6BF} - Application false MultiByte + + + @@ -34,195 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - .\x86\Release/gencnval.tlb + $(OutDir)/gencnval.tlb - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - false - true - .\x86\Release/gencnval.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + false + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/gencnval.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/gencnval.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/gencnval.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/gencnval.pdb Console - false - - + $(OutDir)/gencnval.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/gencnval.tlb - + + + - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - false - true - .\x86\Debug/gencnval.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/gencnval.exe - true icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/gencnval.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/gencnval.tlb - + + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - false - true - .\x64\Release/gencnval.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/gencnval.exe - true icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/gencnval.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/gencnval.tlb - - - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - false - true - .\x64\Debug/gencnval.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/gencnval.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/gencnval.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/gendict/gendict.vcxproj b/Build/source/libs/icu/icu-src/source/tools/gendict/gendict.vcxproj index a419abb475e..4f369567ba1 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gendict/gendict.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/gendict/gendict.vcxproj @@ -1,17 +1,16 @@  - - - {9D4211F7-2C77-439C-82F0-30A4E43BA569} - Application false MultiByte + + + @@ -34,195 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - .\x86\Release/gendict.tlb + $(OutDir)\gendict.tlb - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - true - .\x86\Release/gendict.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + true + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)\gendict.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\gendict.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/gendict.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/gendict.pdb Console - false - - + $(OutDir)\gendict.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/gendict.tlb - + + + - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x86\Debug/gendict.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/gendict.exe - true icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/gendict.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/gendict.tlb - + + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - true - true - .\x64\Release/gendict.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/gendict.exe - true icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/gendict.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/gendict.tlb - - - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x64\Debug/gendict.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/gendict.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/gendict.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/gennorm2/gennorm2.vcxproj b/Build/source/libs/icu/icu-src/source/tools/gennorm2/gennorm2.vcxproj index ec408e27695..2f41299098b 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gennorm2/gennorm2.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/gennorm2/gennorm2.vcxproj @@ -1,14 +1,9 @@  - - - {C7891A65-80AB-4245-912E-5F1E17B0E6C4} gennorm2 - Win32Proj - Application Unicode @@ -16,6 +11,9 @@ true + + + @@ -34,145 +32,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + + + $(OutDir)\gennorm2.tlb + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - false Level3 - - - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - - - MaxSpeed - true - MultiThreadedDLL - true - .\x86\Release\gennorm2.pch - .\x86\Release\ - .\x86\Release\ - .\x86\Release\ - ProgramDatabase Default + false + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)\gennorm2.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\gennorm2.pdb - .\x86\Release\gennorm2.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release\gennorm2.pdb - true Console - true - true - MachineX86 - false - false + $(OutDir)\gennorm2.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) + + + - true - MultiThreadedDebugDLL - .\x86\Debug\gennorm2.pch - .\x86\Debug\ - .\x86\Debug\ - .\x86\Debug\ true - EditAndContinue - Default + MultiThreadedDebugDLL - .\x86\Debug\gennorm2.exe icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug\gennorm2.pdb - Console - false - false - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - + + - MaxSpeed - true MultiThreadedDLL true - .\x64\Release\gennorm2.pch - .\x64\Release\ - .\x64\Release\ - .\x64\Release\ - ProgramDatabase - Default - .\x64\Release\gennorm2.exe icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release\gennorm2.pdb - true - Console - true - false - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - true - MultiThreadedDebugDLL - .\x64\Debug\gennorm2.pch - .\x64\Debug\ - .\x64\Debug\ - .\x64\Debug\ - true - EditAndContinue - Default - - - .\x64\Debug\gennorm2.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug\gennorm2.pdb - Console - false - false diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/Makefile.in b/Build/source/libs/icu/icu-src/source/tools/genrb/Makefile.in index 7e2360b64ec..5e75725ec24 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/Makefile.in +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/Makefile.in @@ -38,7 +38,7 @@ CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=e LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) OBJECTS = errmsg.o genrb.o parse.o read.o reslist.o ustr.o rbutil.o \ -wrtjava.o rle.o wrtxml.o prscmnts.o +wrtjava.o rle.o wrtxml.o prscmnts.o filterrb.o DERB_OBJ = derb.o DEPS = $(OBJECTS:.o=.d) diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/derb.cpp b/Build/source/libs/icu/icu-src/source/tools/genrb/derb.cpp index ac26d95be4c..997b4001295 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/derb.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/derb.cpp @@ -631,7 +631,7 @@ static const char *getEncodingName(const char *encoding) { if (!(enc = ucnv_getStandardName(encoding, "MIME", &err))) { err = U_ZERO_ERROR; if (!(enc = ucnv_getStandardName(encoding, "IANA", &err))) { - ; + // do nothing } } diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/derb.vcxproj b/Build/source/libs/icu/icu-src/source/tools/genrb/derb.vcxproj index d76c3d27def..43edf4c96ef 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/derb.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/derb.vcxproj @@ -1,17 +1,16 @@  - - - {D3065ADB-8820-4CC7-9B6C-9510833961A3} - Application false MultiByte + + + @@ -34,207 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release_derb\ - .\x86\Release_derb\ - false - .\x86\Debug_derb\ - .\x86\Debug_derb\ - true - .\x64\Release_derb\ - .\x64\Release_derb\ - false - .\x64\Debug_derb\ - .\x64\Debug_derb\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\x86\Release_derb/derb.tlb + $(OutDir)/derb.tlb - ..\..\i18n;..\..\common;..\toolutil;..\..\io;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - true - .\x86\Release_derb/derb.pch - .\x86\Release_derb/ - .\x86\Release_derb/ - .\x86\Release_derb/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + true + ..\..\i18n;..\..\common;..\toolutil;..\..\io;%(AdditionalIncludeDirectories) + $(OutDir)/derb.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/derb.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release_derb/derb.exe - true - icuuc.lib;icuin.lib;icuio.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release_derb/derb.pdb Console - false - - + $(OutDir)/derb.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\x86\Debug_derb/derb.tlb - + + + - Disabled - ..\..\i18n;..\..\common;..\toolutil;..\..\io;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks + true MultiThreadedDebugDLL - true - true - true - .\x86\Debug_derb/derb.pch - .\x86\Debug_derb/ - .\x86\Debug_derb/ - .\x86\Debug_derb/ - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug_derb/derb.exe - true icuucd.lib;icuind.lib;icuiod.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug_derb/derb.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\x64\Release_derb/derb.tlb - + + - ..\..\i18n;..\..\common;..\toolutil;..\..\io;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - true - true - .\x64\Release_derb/derb.pch - .\x64\Release_derb/ - .\x64\Release_derb/ - .\x64\Release_derb/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release_derb/derb.exe - true icuuc.lib;icuin.lib;icuio.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release_derb/derb.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\x64\Debug_derb/derb.tlb - - - Disabled - ..\..\i18n;..\..\common;..\toolutil;..\..\io;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x64\Debug_derb/derb.pch - .\x64\Debug_derb/ - .\x64\Debug_derb/ - .\x64\Debug_derb/ - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug_derb/derb.exe - true - icuucd.lib;icuind.lib;icuiod.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug_derb/derb.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/filterrb.cpp b/Build/source/libs/icu/icu-src/source/tools/genrb/filterrb.cpp new file mode 100644 index 00000000000..dcc02fc6210 --- /dev/null +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/filterrb.cpp @@ -0,0 +1,239 @@ +// © 2018 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html + +#include +#include + +#include "filterrb.h" +#include "errmsg.h" + + +const char* PathFilter::kEInclusionNames[] = { + "INCLUDE", + "PARTIAL", + "EXCLUDE" +}; + + +ResKeyPath::ResKeyPath() {} + +ResKeyPath::ResKeyPath(const std::string& path, UErrorCode& status) { + if (path.empty() || path[0] != '/') { + std::cerr << "genrb error: path must start with /: " << path << std::endl; + status = U_PARSE_ERROR; + return; + } + if (path.length() == 1) { + return; + } + size_t i; + size_t j = 0; + while (true) { + i = j + 1; + j = path.find('/', i); + std::string key = path.substr(i, j - i); + if (key.empty()) { + std::cerr << "genrb error: empty subpaths and trailing slashes are not allowed: " << path << std::endl; + status = U_PARSE_ERROR; + return; + } + push(key); + if (j == std::string::npos) { + break; + } + } +} + +void ResKeyPath::push(const std::string& key) { + fPath.push_back(key); +} + +void ResKeyPath::pop() { + fPath.pop_back(); +} + +const std::list& ResKeyPath::pieces() const { + return fPath; +} + +std::ostream& operator<<(std::ostream& out, const ResKeyPath& value) { + if (value.pieces().empty()) { + out << "/"; + } else for (auto& key : value.pieces()) { + out << "/" << key; + } + return out; +} + + +PathFilter::~PathFilter() = default; + + +void SimpleRuleBasedPathFilter::addRule(const std::string& ruleLine, UErrorCode& status) { + if (ruleLine.empty()) { + std::cerr << "genrb error: empty filter rules are not allowed" << std::endl; + status = U_PARSE_ERROR; + return; + } + bool inclusionRule = false; + if (ruleLine[0] == '+') { + inclusionRule = true; + } else if (ruleLine[0] != '-') { + std::cerr << "genrb error: rules must start with + or -: " << ruleLine << std::endl; + status = U_PARSE_ERROR; + return; + } + ResKeyPath path(ruleLine.substr(1), status); + addRule(path, inclusionRule, status); +} + +void SimpleRuleBasedPathFilter::addRule(const ResKeyPath& path, bool inclusionRule, UErrorCode& status) { + if (U_FAILURE(status)) { + return; + } + fRoot.applyRule(path, path.pieces().begin(), inclusionRule, status); +} + +PathFilter::EInclusion SimpleRuleBasedPathFilter::match(const ResKeyPath& path) const { + const Tree* node = &fRoot; + + // defaultResult "bubbles up" the nearest "definite" inclusion/exclusion rule + EInclusion defaultResult = INCLUDE; + if (node->fIncluded != PARTIAL) { + // rules handled here: "+/" and "-/" + defaultResult = node->fIncluded; + } + + // isLeaf is whether the filter tree can provide no additional information + // even if additional subpaths are added to the given key + bool isLeaf = false; + + for (auto& key : path.pieces()) { + auto child = node->fChildren.find(key); + // Leaf case 1: input path descends outside the filter tree + if (child == node->fChildren.end()) { + if (node->fWildcard) { + // A wildcard pattern is present; continue checking + node = node->fWildcard.get(); + } else { + isLeaf = true; + break; + } + } else { + node = &child->second; + } + if (node->fIncluded != PARTIAL) { + defaultResult = node->fIncluded; + } + } + + // Leaf case 2: input path exactly matches a filter leaf + if (node->isLeaf()) { + isLeaf = true; + } + + // Always return PARTIAL if we are not at a leaf + if (!isLeaf) { + return PARTIAL; + } + + // If leaf node is PARTIAL, return the default + if (node->fIncluded == PARTIAL) { + return defaultResult; + } + + return node->fIncluded; +} + + +SimpleRuleBasedPathFilter::Tree::Tree(const Tree& other) + : fIncluded(other.fIncluded), fChildren(other.fChildren) { + // Note: can't use the default copy assignment because of the std::unique_ptr + if (other.fWildcard) { + fWildcard.reset(new Tree(*other.fWildcard)); + } +} + +bool SimpleRuleBasedPathFilter::Tree::isLeaf() const { + return fChildren.empty() && !fWildcard; +} + +void SimpleRuleBasedPathFilter::Tree::applyRule( + const ResKeyPath& path, + std::list::const_iterator it, + bool inclusionRule, + UErrorCode& status) { + + // Base Case + if (it == path.pieces().end()) { + if (isVerbose() && (fIncluded != PARTIAL || !isLeaf())) { + std::cout << "genrb info: rule on path " << path + << " overrides previous rules" << std::endl; + } + fIncluded = inclusionRule ? INCLUDE : EXCLUDE; + fChildren.clear(); + fWildcard.reset(); + return; + } + + // Recursive Step + auto& key = *it; + if (key == "*") { + // Case 1: Wildcard + if (!fWildcard) { + fWildcard.reset(new Tree()); + } + // Apply the rule to fWildcard and also to all existing children. + it++; + fWildcard->applyRule(path, it, inclusionRule, status); + for (auto& child : fChildren) { + child.second.applyRule(path, it, inclusionRule, status); + } + it--; + + } else { + // Case 2: Normal Key + auto search = fChildren.find(key); + if (search == fChildren.end()) { + if (fWildcard) { + // Deep-copy the existing wildcard tree into the new key + search = fChildren.emplace(key, Tree(*fWildcard)).first; + } else { + search = fChildren.emplace(key, Tree()).first; + } + } + it++; + search->second.applyRule(path, it, inclusionRule, status); + it--; + } +} + +void SimpleRuleBasedPathFilter::Tree::print(std::ostream& out, int32_t indent) const { + for (int32_t i=0; iprint(out, indent + 1); + for (int32_t i=0; i +#include +#include +#include +#include + +#include "unicode/utypes.h" + + +/** + * Represents an absolute path into a resource bundle. + * For example: "/units/length/meter" + */ +class ResKeyPath { +public: + /** Constructs an empty path (top of tree) */ + ResKeyPath(); + + /** Constructs from a string path */ + ResKeyPath(const std::string& path, UErrorCode& status); + + void push(const std::string& key); + void pop(); + + const std::list& pieces() const; + + private: + std::list fPath; +}; + +std::ostream& operator<<(std::ostream& out, const ResKeyPath& value); + + +/** + * Interface used to determine whether to include or reject pieces of a + * resource bundle based on their absolute path. + */ +class PathFilter { +public: + enum EInclusion { + INCLUDE, + PARTIAL, + EXCLUDE + }; + + static const char* kEInclusionNames[]; + + virtual ~PathFilter(); + + /** + * Returns an EInclusion on whether or not the given path should be included. + * + * INCLUDE = include the whole subtree + * PARTIAL = recurse into the subtree + * EXCLUDE = reject the whole subtree + */ + virtual EInclusion match(const ResKeyPath& path) const = 0; +}; + + +/** + * Implementation of PathFilter for a list of inclusion/exclusion rules. + * + * The wildcard pattern "*" means that the subsequent filters are applied to + * every other tree sharing the same parent. + * + * For example, given this list of filter rules: + */ +// -/alabama +// +/alabama/alaska/arizona +// -/fornia/hawaii +// -/mississippi +// +/mississippi/michigan +// +/mississippi/*/maine +// -/mississippi/*/iowa +// +/mississippi/louisiana/iowa +/* + * You get the following structure: + * + * SimpleRuleBasedPathFilter { + * included: PARTIAL + * alabama: { + * included: EXCLUDE + * alaska: { + * included: PARTIAL + * arizona: { + * included: INCLUDE + * } + * } + * } + * fornia: { + * included: PARTIAL + * hawaii: { + * included: EXCLUDE + * } + * } + * mississippi: { + * included: EXCLUDE + * louisiana: { + * included: PARTIAL + * iowa: { + * included: INCLUDE + * } + * maine: { + * included: INCLUDE + * } + * } + * michigan: { + * included: INCLUDE + * iowa: { + * included: EXCLUDE + * } + * maine: { + * included: INCLUDE + * } + * } + * * { + * included: PARTIAL + * iowa: { + * included: EXCLUDE + * } + * maine: { + * included: INCLUDE + * } + * } + * } + * } + */ +class SimpleRuleBasedPathFilter : public PathFilter { +public: + void addRule(const std::string& ruleLine, UErrorCode& status); + void addRule(const ResKeyPath& path, bool inclusionRule, UErrorCode& status); + + EInclusion match(const ResKeyPath& path) const override; + + void print(std::ostream& out) const; + +private: + struct Tree { + + Tree() = default; + + /** Copy constructor */ + Tree(const Tree& other); + + /** + * Information on the USER-SPECIFIED inclusion/exclusion. + * + * INCLUDE = this path exactly matches a "+" rule + * PARTIAL = this path does not match any rule, but subpaths exist + * EXCLUDE = this path exactly matches a "-" rule + */ + EInclusion fIncluded = PARTIAL; + std::map fChildren; + std::unique_ptr fWildcard; + + void applyRule( + const ResKeyPath& path, + std::list::const_iterator it, + bool inclusionRule, + UErrorCode& status); + + bool isLeaf() const; + + void print(std::ostream& out, int32_t indent) const; + }; + + Tree fRoot; +}; + +std::ostream& operator<<(std::ostream& out, const SimpleRuleBasedPathFilter& value); + + +#endif //__FILTERRB_H__ diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.cpp b/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.cpp index c4fc462066a..6f3a13a0a61 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.cpp @@ -18,6 +18,11 @@ ******************************************************************************* */ +#include +#include +#include +#include + #include #include "genrb.h" #include "unicode/localpointer.h" @@ -25,13 +30,15 @@ #include "unicode/utf16.h" #include "charstr.h" #include "cmemory.h" +#include "filterrb.h" #include "reslist.h" #include "ucmndata.h" /* TODO: for reading the pool bundle */ U_NAMESPACE_USE /* Protos */ -void processFile(const char *filename, const char* cp, const char *inputDir, const char *outputDir, +void processFile(const char *filename, const char* cp, + const char *inputDir, const char *outputDir, const char *filterDir, const char *packageName, SRBRoot *newPoolBundle, UBool omitBinaryCollation, UErrorCode &status); static char *make_res_filename(const char *filename, const char *outputDir, @@ -76,7 +83,8 @@ enum FORMAT_VERSION, WRITE_POOL_BUNDLE, USE_POOL_BUNDLE, - INCLUDE_UNIHAN_COLL + INCLUDE_UNIHAN_COLL, + FILTERDIR }; UOption options[]={ @@ -99,9 +107,10 @@ UOption options[]={ UOPTION_DEF("language", 'l', UOPT_REQUIRES_ARG), /* 16 */ UOPTION_DEF("omitCollationRules", 'R', UOPT_NO_ARG),/* 17 */ UOPTION_DEF("formatVersion", '\x01', UOPT_REQUIRES_ARG),/* 18 */ - UOPTION_DEF("writePoolBundle", '\x01', UOPT_NO_ARG),/* 19 */ + UOPTION_DEF("writePoolBundle", '\x01', UOPT_OPTIONAL_ARG),/* 19 */ UOPTION_DEF("usePoolBundle", '\x01', UOPT_OPTIONAL_ARG),/* 20 */ UOPTION_DEF("includeUnihanColl", '\x01', UOPT_NO_ARG),/* 21 */ /* temporary, don't display in usage info */ + UOPTION_DEF("filterDir", '\x01', UOPT_OPTIONAL_ARG), /* 22 */ }; static UBool write_java = FALSE; @@ -121,6 +130,7 @@ main(int argc, const char *arg = NULL; const char *outputDir = NULL; /* NULL = no output directory, use current */ const char *inputDir = NULL; + const char *filterDir = NULL; const char *encoding = ""; int i; UBool illegalArg = FALSE; @@ -195,10 +205,10 @@ main(int argc, "\t-c or --copyright include copyright notice\n"); fprintf(stderr, "\t-e or --encoding encoding of source files\n" - "\t-d of --destdir destination directory, followed by the path, defaults to %s\n" - "\t-s or --sourcedir source directory for files followed by path, defaults to %s\n" + "\t-d or --destdir destination directory, followed by the path, defaults to '%s'\n" + "\t-s or --sourcedir source directory for files followed by path, defaults to '%s'\n" "\t-i or --icudatadir directory for locating any needed intermediate data files,\n" - "\t followed by path, defaults to %s\n", + "\t followed by path, defaults to '%s'\n", u_getDataDirectory(), u_getDataDirectory(), u_getDataDirectory()); fprintf(stderr, "\t-j or --write-java write a Java ListResourceBundle for ICU4J, followed by optional encoding\n" @@ -224,10 +234,13 @@ main(int argc, "\t --formatVersion write a .res file compatible with the requested formatVersion (single digit);\n" "\t for example, --formatVersion 1\n"); fprintf(stderr, - "\t --writePoolBundle write a pool.res file with all of the keys of all input bundles\n" - "\t --usePoolBundle [path-to-pool.res] point to keys from the pool.res keys pool bundle if they are available there;\n" + "\t --writePoolBundle [directory] write a pool.res file with all of the keys of all input bundles\n" + "\t --usePoolBundle [directory] point to keys from the pool.res keys pool bundle if they are available there;\n" "\t makes .res files smaller but dependent on the pool bundle\n" "\t (--writePoolBundle and --usePoolBundle cannot be combined)\n"); + fprintf(stderr, + "\t --filterDir Input directory where filter files are available.\n" + "\t For more on filter files, see ICU Data Build Tool.\n"); return illegalArg ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR; } @@ -254,6 +267,10 @@ main(int argc, outputDir = options[DESTDIR].value; } + if (options[FILTERDIR].doesOccur) { + filterDir = options[FILTERDIR].value; + } + if(options[ENCODING].doesOccur) { encoding = options[ENCODING].value; } @@ -524,7 +541,7 @@ main(int argc, if (isVerbose()) { printf("Processing file \"%s\"\n", theCurrentFileName.data()); } - processFile(arg, encoding, inputDir, outputDir, NULL, + processFile(arg, encoding, inputDir, outputDir, filterDir, NULL, newPoolBundle.getAlias(), options[NO_BINARY_COLLATION].doesOccur, status); } @@ -532,8 +549,14 @@ main(int argc, poolBundle.close(); if(U_SUCCESS(status) && options[WRITE_POOL_BUNDLE].doesOccur) { + const char* writePoolDir; + if (options[WRITE_POOL_BUNDLE].value!=NULL) { + writePoolDir = options[WRITE_POOL_BUNDLE].value; + } else { + writePoolDir = outputDir; + } char outputFileName[256]; - newPoolBundle->write(outputDir, NULL, outputFileName, sizeof(outputFileName), status); + newPoolBundle->write(writePoolDir, NULL, outputFileName, sizeof(outputFileName), status); if(U_FAILURE(status)) { fprintf(stderr, "unable to write the pool bundle: %s\n", u_errorName(status)); } @@ -552,19 +575,17 @@ main(int argc, /* Process a file */ void processFile(const char *filename, const char *cp, - const char *inputDir, const char *outputDir, const char *packageName, + const char *inputDir, const char *outputDir, const char *filterDir, + const char *packageName, SRBRoot *newPoolBundle, UBool omitBinaryCollation, UErrorCode &status) { LocalPointer data; - UCHARBUF *ucbuf = NULL; - char *rbname = NULL; - char *openFileName = NULL; - char *inputDirBuf = NULL; - - char outputFileName[256]; + LocalUCHARBUFPointer ucbuf; + CharString openFileName; + CharString inputDirBuf; + char outputFileName[256]; int32_t dirlen = 0; - int32_t filelen = 0; if (U_FAILURE(status)) { return; @@ -572,14 +593,10 @@ processFile(const char *filename, const char *cp, if(filename==NULL){ status=U_ILLEGAL_ARGUMENT_ERROR; return; - }else{ - filelen = (int32_t)uprv_strlen(filename); } if(inputDir == NULL) { const char *filenameBegin = uprv_strrchr(filename, U_FILE_SEP_CHAR); - openFileName = (char *) uprv_malloc(dirlen + filelen + 2); - openFileName[0] = '\0'; if (filenameBegin != NULL) { /* * When a filename ../../../data/root.txt is specified, @@ -588,31 +605,15 @@ processFile(const char *filename, const char *cp, * another file, like UCARules.txt or thaidict.brk. */ int32_t filenameSize = (int32_t)(filenameBegin - filename + 1); - inputDirBuf = uprv_strncpy((char *)uprv_malloc(filenameSize), filename, filenameSize); - - /* test for NULL */ - if(inputDirBuf == NULL) { - status = U_MEMORY_ALLOCATION_ERROR; - goto finish; - } + inputDirBuf.append(filename, filenameSize, status); - inputDirBuf[filenameSize - 1] = 0; - inputDir = inputDirBuf; - dirlen = (int32_t)uprv_strlen(inputDir); + inputDir = inputDirBuf.data(); + dirlen = inputDirBuf.length(); } }else{ dirlen = (int32_t)uprv_strlen(inputDir); if(inputDir[dirlen-1] != U_FILE_SEP_CHAR) { - openFileName = (char *) uprv_malloc(dirlen + filelen + 2); - - /* test for NULL */ - if(openFileName == NULL) { - status = U_MEMORY_ALLOCATION_ERROR; - goto finish; - } - - openFileName[0] = '\0'; /* * append the input dir to openFileName if the first char in * filename is not file seperation char and the last char input directory is not '.'. @@ -625,49 +626,80 @@ processFile(const char *filename, const char *cp, * genrb -s. icu/data --- start from CWD and look in icu/data dir */ if( (filename[0] != U_FILE_SEP_CHAR) && (inputDir[dirlen-1] !='.')){ - uprv_strcpy(openFileName, inputDir); - openFileName[dirlen] = U_FILE_SEP_CHAR; + openFileName.append(inputDir, status); } - openFileName[dirlen + 1] = '\0'; } else { - openFileName = (char *) uprv_malloc(dirlen + filelen + 1); - - /* test for NULL */ - if(openFileName == NULL) { - status = U_MEMORY_ALLOCATION_ERROR; - goto finish; - } - - uprv_strcpy(openFileName, inputDir); - + openFileName.append(inputDir, status); } } + openFileName.appendPathPart(filename, status); - uprv_strcat(openFileName, filename); + // Test for CharString failure + if (U_FAILURE(status)) { + return; + } - ucbuf = ucbuf_open(openFileName, &cp,getShowWarning(),TRUE, &status); + ucbuf.adoptInstead(ucbuf_open(openFileName.data(), &cp,getShowWarning(),TRUE, &status)); if(status == U_FILE_ACCESS_ERROR) { - fprintf(stderr, "couldn't open file %s\n", openFileName == NULL ? filename : openFileName); - goto finish; + fprintf(stderr, "couldn't open file %s\n", openFileName.data()); + return; } - if (ucbuf == NULL || U_FAILURE(status)) { + if (ucbuf.isNull() || U_FAILURE(status)) { fprintf(stderr, "An error occurred processing file %s. Error: %s\n", - openFileName == NULL ? filename : openFileName, u_errorName(status)); - goto finish; + openFileName.data(), u_errorName(status)); + return; } /* auto detected popular encodings? */ if (cp!=NULL && isVerbose()) { printf("autodetected encoding %s\n", cp); } /* Parse the data into an SRBRoot */ - data.adoptInstead(parse(ucbuf, inputDir, outputDir, filename, + data.adoptInstead(parse(ucbuf.getAlias(), inputDir, outputDir, filename, !omitBinaryCollation, options[NO_COLLATION_RULES].doesOccur, &status)); if (data.isNull() || U_FAILURE(status)) { fprintf(stderr, "couldn't parse the file %s. Error:%s\n", filename, u_errorName(status)); - goto finish; + return; } + + // Run filtering before writing pool bundle + if (filterDir != nullptr) { + CharString filterFileName(filterDir, status); + filterFileName.appendPathPart(filename, status); + if (U_FAILURE(status)) { + return; + } + + // Open the file and read it into filter + SimpleRuleBasedPathFilter filter; + std::ifstream f(filterFileName.data()); + if (f.fail()) { + std::cerr << "genrb error: unable to open " << filterFileName.data() << std::endl; + status = U_FILE_ACCESS_ERROR; + return; + } + std::string currentLine; + while (std::getline(f, currentLine)) { + // Ignore # comments and empty lines + if (currentLine.empty() || currentLine[0] == '#') { + continue; + } + filter.addRule(currentLine, status); + if (U_FAILURE(status)) { + return; + } + } + + if (isVerbose()) { + filter.print(std::cout); + } + + // Apply the filter to the data + ResKeyPath path; + data->fRoot->applyFilter(filter, path, data.getAlias()); + } + if(options[WRITE_POOL_BUNDLE].doesOccur) { data->fWritePoolBundle = newPoolBundle; data->compactKeys(status); @@ -677,7 +709,7 @@ processFile(const char *filename, const char *cp, if(U_FAILURE(status)) { fprintf(stderr, "bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s\n", filename, u_errorName(status)); - goto finish; + return; } /* count the number of just-added key strings */ for(const char *newKeysLimit = newKeys + newKeysLength; newKeys < newKeysLimit; ++newKeys) { @@ -692,11 +724,11 @@ processFile(const char *filename, const char *cp, } /* Determine the target rb filename */ - rbname = make_res_filename(filename, outputDir, packageName, status); + uprv_free(make_res_filename(filename, outputDir, packageName, status)); if(U_FAILURE(status)) { fprintf(stderr, "couldn't make the res fileName for bundle %s. Error:%s\n", filename, u_errorName(status)); - goto finish; + return; } if(write_java== TRUE){ bundle_write_java(data.getAlias(), outputDir, outputEnc, @@ -713,24 +745,6 @@ processFile(const char *filename, const char *cp, if (U_FAILURE(status)) { fprintf(stderr, "couldn't write bundle %s. Error:%s\n", outputFileName, u_errorName(status)); } - -finish: - - if (inputDirBuf != NULL) { - uprv_free(inputDirBuf); - } - - if (openFileName != NULL) { - uprv_free(openFileName); - } - - if(ucbuf) { - ucbuf_close(ucbuf); - } - - if (rbname) { - uprv_free(rbname); - } } /* Generate the target .res file name from the input file name */ diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj b/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj index 13c8aa855d2..166ce733b94 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj @@ -1,17 +1,16 @@  - - - {97521D06-EC47-45D4-8BD0-9E16B3F93B2A} - Application false MultiByte + + + @@ -34,199 +33,63 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - WINVER=0x0601;_WIN32_WINNT=0x0601;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - - .\x86\Release/genrb.tlb + $(OutDir)/genrb.tlb - ..\..\..\include;..\..\common;..\toolutil;..\..\i18n;%(AdditionalIncludeDirectories) - true - MultiThreadedDLL - true - true - .\x86\Release/genrb.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + true + ..\..\..\include;..\..\common;..\toolutil;..\..\i18n;%(AdditionalIncludeDirectories) + $(OutDir)/genrb.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/genrb.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/genrb.exe - true - icuuc.lib;icuin.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/genrb.pdb Console - false - - + $(OutDir)/genrb.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/genrb.tlb - + + + - Disabled - ..\..\..\include;..\..\common;..\toolutil;..\..\i18n;%(AdditionalIncludeDirectories) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x86\Debug/genrb.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/genrb.exe - true icuucd.lib;icuind.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/genrb.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/genrb.tlb - + + - ..\..\..\include;..\..\common;..\toolutil;..\..\i18n;%(AdditionalIncludeDirectories) - true MultiThreadedDLL - true - true - .\x64\Release/genrb.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true + true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/genrb.exe - true icuuc.lib;icuin.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/genrb.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/genrb.tlb - - - Disabled - ..\..\..\include;..\..\common;..\toolutil;..\..\i18n;%(AdditionalIncludeDirectories) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x64\Debug/genrb.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/genrb.exe - true - icuucd.lib;icuind.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/genrb.pdb - Console - MachineX64 + false @@ -251,6 +114,7 @@ + diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj.filters b/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj.filters index 73de73044c8..1f2f5b3b8cb 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj.filters +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/genrb.vcxproj.filters @@ -18,6 +18,9 @@ Source Files + + Source Files + Source Files @@ -53,6 +56,9 @@ Header Files + + Header Files + Header Files diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/parse.cpp b/Build/source/libs/icu/icu-src/source/tools/genrb/parse.cpp index 44eb0c082bc..18a8c76dbc5 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/parse.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/parse.cpp @@ -274,11 +274,11 @@ expect(ParseState* state, enum ETokenType expectedToken, struct UString **tokenV } } -static char *getInvariantString(ParseState* state, uint32_t *line, struct UString *comment, UErrorCode *status) +static char *getInvariantString(ParseState* state, uint32_t *line, struct UString *comment, + int32_t &stringLength, UErrorCode *status) { struct UString *tokenValue; char *result; - uint32_t count; expect(state, TOK_STRING, &tokenValue, comment, line, status); @@ -287,14 +287,13 @@ static char *getInvariantString(ParseState* state, uint32_t *line, struct UStrin return NULL; } - count = u_strlen(tokenValue->fChars); - if(!uprv_isInvariantUString(tokenValue->fChars, count)) { + if(!uprv_isInvariantUString(tokenValue->fChars, tokenValue->fLength)) { *status = U_INVALID_FORMAT_ERROR; error(*line, "invariant characters required for table keys, binary data, etc."); return NULL; } - result = static_cast(uprv_malloc(count+1)); + result = static_cast(uprv_malloc(tokenValue->fLength+1)); if (result == NULL) { @@ -302,7 +301,8 @@ static char *getInvariantString(ParseState* state, uint32_t *line, struct UStrin return NULL; } - u_UCharsToChars(tokenValue->fChars, result, count+1); + u_UCharsToChars(tokenValue->fChars, result, tokenValue->fLength+1); + stringLength = tokenValue->fLength; return result; } @@ -537,7 +537,7 @@ parseDependency(ParseState* state, char *tag, uint32_t startline, const struct U uint32_t line; char filename[256] = { '\0' }; char cs[128] = { '\0' }; - + expect(state, TOK_STRING, &tokenValue, NULL, &line, status); if(isVerbose()){ @@ -558,7 +558,7 @@ parseDependency(ParseState* state, char *tag, uint32_t startline, const struct U uprv_strcat(filename, U_FILE_SEP_STRING); } } - + u_UCharsToChars(tokenValue->fChars, cs, tokenValue->fLength); if (U_FAILURE(*status)) @@ -570,7 +570,7 @@ parseDependency(ParseState* state, char *tag, uint32_t startline, const struct U if(isStrict()){ error(line, "The dependency file %s does not exist. Please make sure it exists.\n",filename); }else{ - warning(line, "The dependency file %s does not exist. Please make sure it exists.\n",filename); + warning(line, "The dependency file %s does not exist. Please make sure it exists.\n",filename); } } if(dependencyArray==NULL){ @@ -1371,7 +1371,6 @@ parseIntVector(ParseState* state, char *tag, uint32_t startline, const struct US int32_t value; UBool readToken = FALSE; char *stopstring; - uint32_t len; struct UString memberComments; IntVectorResource *result = intvector_open(state->bundle, tag, comment, status); @@ -1404,7 +1403,8 @@ parseIntVector(ParseState* state, char *tag, uint32_t startline, const struct US return result; } - string = getInvariantString(state, NULL, NULL, status); + int32_t stringLength; + string = getInvariantString(state, NULL, NULL, stringLength, status); if (U_FAILURE(*status)) { @@ -1414,9 +1414,9 @@ parseIntVector(ParseState* state, char *tag, uint32_t startline, const struct US /* For handling illegal char in the Intvector */ value = uprv_strtoul(string, &stopstring, 0);/* make intvector support decimal,hexdigit,octal digit ranging from -2^31-2^32-1*/ - len=(uint32_t)(stopstring-string); + int32_t len = (int32_t)(stopstring-string); - if(len==uprv_strlen(string)) + if(len==stringLength) { result->add(value, *status); uprv_free(string); @@ -1454,7 +1454,8 @@ static struct SResource * parseBinary(ParseState* state, char *tag, uint32_t startline, const struct UString *comment, UErrorCode *status) { uint32_t line; - LocalMemory string(getInvariantString(state, &line, NULL, status)); + int32_t stringLength; + LocalMemory string(getInvariantString(state, &line, NULL, stringLength, status)); if (string.isNull() || U_FAILURE(*status)) { return NULL; @@ -1470,46 +1471,45 @@ parseBinary(ParseState* state, char *tag, uint32_t startline, const struct UStri printf(" binary %s at line %i \n", (tag == NULL) ? "(null)" : tag, (int)startline); } - uint32_t count = (uint32_t)uprv_strlen(string.getAlias()); - if (count > 0){ - if((count % 2)==0){ - LocalMemory value; - if (value.allocateInsteadAndCopy(count) == NULL) - { - *status = U_MEMORY_ALLOCATION_ERROR; - return NULL; - } - - char toConv[3] = {'\0', '\0', '\0'}; - for (uint32_t i = 0; i < count; i += 2) - { - toConv[0] = string[i]; - toConv[1] = string[i + 1]; + LocalMemory value; + int32_t count = 0; + if (stringLength > 0 && value.allocateInsteadAndCopy(stringLength) == NULL) + { + *status = U_MEMORY_ALLOCATION_ERROR; + return NULL; + } - char *stopstring; - value[i >> 1] = (uint8_t) uprv_strtoul(toConv, &stopstring, 16); - uint32_t len=(uint32_t)(stopstring-toConv); + char toConv[3] = {'\0', '\0', '\0'}; + for (int32_t i = 0; i < stringLength;) + { + // Skip spaces (which may have been line endings). + char c0 = string[i++]; + if (c0 == ' ') { continue; } + if (i == stringLength) { + *status=U_INVALID_CHAR_FOUND; + error(line, "Encountered invalid binary value (odd number of hex digits)"); + return NULL; + } + toConv[0] = c0; + toConv[1] = string[i++]; - if(len!=2) - { - *status=U_INVALID_CHAR_FOUND; - return NULL; - } - } + char *stopstring; + value[count++] = (uint8_t) uprv_strtoul(toConv, &stopstring, 16); + uint32_t len=(uint32_t)(stopstring-toConv); - return bin_open(state->bundle, tag, count >> 1, value.getAlias(), NULL, comment, status); - } - else + if(len!=2) { - *status = U_INVALID_CHAR_FOUND; - error(line, "Encountered invalid binary value (length is odd)"); + *status=U_INVALID_CHAR_FOUND; + error(line, "Encountered invalid binary value (not all pairs of hex digits)"); return NULL; } } - else - { + + if (count == 0) { warning(startline, "Encountered empty binary value"); return bin_open(state->bundle, tag, 0, NULL, "", comment, status); + } else { + return bin_open(state->bundle, tag, count, value.getAlias(), NULL, comment, status); } } @@ -1520,9 +1520,9 @@ parseInteger(ParseState* state, char *tag, uint32_t startline, const struct UStr int32_t value; char *string; char *stopstring; - uint32_t len; - string = getInvariantString(state, NULL, NULL, status); + int32_t stringLength; + string = getInvariantString(state, NULL, NULL, stringLength, status); if (string == NULL || U_FAILURE(*status)) { @@ -1541,7 +1541,7 @@ parseInteger(ParseState* state, char *tag, uint32_t startline, const struct UStr printf(" integer %s at line %i \n", (tag == NULL) ? "(null)" : tag, (int)startline); } - if (uprv_strlen(string) <= 0) + if (stringLength == 0) { warning(startline, "Encountered empty integer. Default value is 0."); } @@ -1549,8 +1549,8 @@ parseInteger(ParseState* state, char *tag, uint32_t startline, const struct UStr /* Allow integer support for hexdecimal, octal digit and decimal*/ /* and handle illegal char in the integer*/ value = uprv_strtoul(string, &stopstring, 0); - len=(uint32_t)(stopstring-string); - if(len==uprv_strlen(string)) + int32_t len = (int32_t)(stopstring-string); + if(len==stringLength) { result = int_open(state->bundle, tag, value, comment, status); } @@ -1567,7 +1567,8 @@ static struct SResource * parseImport(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status) { uint32_t line; - LocalMemory filename(getInvariantString(state, &line, NULL, status)); + int32_t stringLength; + LocalMemory filename(getInvariantString(state, &line, NULL, stringLength, status)); if (U_FAILURE(*status)) { return NULL; @@ -1628,12 +1629,11 @@ parseInclude(ParseState* state, char *tag, uint32_t startline, const struct UStr UCHARBUF *ucbuf; char *fullname = NULL; - int32_t count = 0; const char* cp = NULL; const UChar* uBuffer = NULL; - filename = getInvariantString(state, &line, NULL, status); - count = (int32_t)uprv_strlen(filename); + int32_t stringLength; + filename = getInvariantString(state, &line, NULL, stringLength, status); if (U_FAILURE(*status)) { @@ -1652,7 +1652,7 @@ parseInclude(ParseState* state, char *tag, uint32_t startline, const struct UStr printf(" include %s at line %i \n", (tag == NULL) ? "(null)" : tag, (int)startline); } - fullname = (char *) uprv_malloc(state->inputdirLength + count + 2); + fullname = (char *) uprv_malloc(state->inputdirLength + stringLength + 2); /* test for NULL */ if(fullname == NULL) { @@ -2000,6 +2000,8 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, const char *fi if (state.bundle == NULL || U_FAILURE(*status)) { + delete state.bundle; + return NULL; } diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.cpp b/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.cpp index 0493347ebe5..3186c781e93 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.cpp @@ -28,13 +28,17 @@ #endif #include +#include +#include #include + #include "unicode/localpointer.h" #include "reslist.h" #include "unewdata.h" #include "unicode/ures.h" #include "unicode/putil.h" #include "errmsg.h" +#include "filterrb.h" #include "uarrsort.h" #include "uelement.h" @@ -42,6 +46,8 @@ #include "uinvchar.h" #include "ustr_imp.h" #include "unicode/utf16.h" +#include "uassert.h" + /* * Align binary data at a 16-byte offset from the start of the resource bundle, * to be safe for any data type it may contain. @@ -921,9 +927,6 @@ void SRBRoot::write(const char *outputDir, const char *outputPkg, if (f16BitUnits.length() & 1) { f16BitUnits.append((UChar)0xaaaa); /* pad to multiple of 4 bytes */ } - /* all keys have been mapped */ - uprv_free(fKeyMap); - fKeyMap = NULL; byteOffset = fKeysTop + f16BitUnits.length() * 2; fRoot->preWrite(&byteOffset); @@ -1037,14 +1040,15 @@ void SRBRoot::write(const char *outputDir, const char *outputPkg, // Swap to big-endian so we get the same checksum on all platforms // (except for charset family, due to the key strings). UnicodeString s(f16BitUnits); - s.append((UChar)1); // Ensure that we own this buffer. assert(!s.isBogus()); - uint16_t *p = const_cast(reinterpret_cast(s.getBuffer())); + // .getBuffer(capacity) returns a mutable buffer + char16_t* p = s.getBuffer(f16BitUnits.length()); for (int32_t count = f16BitUnits.length(); count > 0; --count) { uint16_t x = *p; *p++ = (uint16_t)((x << 8) | (x >> 8)); } - checksum = computeCRC((const char *)p, + s.releaseBuffer(f16BitUnits.length()); + checksum = computeCRC((const char *)s.getBuffer(), (uint32_t)f16BitUnits.length() * 2, checksum); } indexes[URES_INDEX_POOL_CHECKSUM] = (int32_t)checksum; @@ -1127,7 +1131,8 @@ SRBRoot::SRBRoot(const UString *comment, UBool isPoolBundle, UErrorCode &errorCo : fRoot(NULL), fLocale(NULL), fIndexLength(0), fMaxTableLength(0), fNoFallback(FALSE), fStringsForm(STRINGS_UTF16_V1), fIsPoolBundle(isPoolBundle), fKeys(NULL), fKeyMap(NULL), - fKeysBottom(0), fKeysTop(0), fKeysCapacity(0), fKeysCount(0), fLocalKeyLimit(0), + fKeysBottom(0), fKeysTop(0), fKeysCapacity(0), + fKeysCount(0), fLocalKeyLimit(0), f16BitUnits(), f16BitStringsLength(0), fUsePoolBundle(&kNoPoolBundle), fPoolStringIndexLimit(0), fPoolStringIndex16Limit(0), fLocalStringIndexLimit(0), @@ -1232,6 +1237,9 @@ int32_t SRBRoot::addKeyBytes(const char *keyBytes, int32_t length, UErrorCode &errorCode) { int32_t keypos; + // It is not legal to add new key bytes after compactKeys is run! + U_ASSERT(fKeyMap == nullptr); + if (U_FAILURE(errorCode)) { return -1; } @@ -1333,13 +1341,37 @@ compareKeyOldpos(const void * /*context*/, const void *l, const void *r) { return compareInt32(((const KeyMapEntry *)l)->oldpos, ((const KeyMapEntry *)r)->oldpos); } +void SResource::collectKeys(std::function collector) const { + collector(fKey); +} + +void ContainerResource::collectKeys(std::function collector) const { + collector(fKey); + for (SResource* curr = fFirst; curr != NULL; curr = curr->fNext) { + curr->collectKeys(collector); + } +} + void SRBRoot::compactKeys(UErrorCode &errorCode) { KeyMapEntry *map; char *keys; int32_t i; + + // Except for pool bundles, keys might not be used. + // Do not add unused keys to the final bundle. + std::set keysInUse; + if (!fIsPoolBundle) { + fRoot->collectKeys([&keysInUse](int32_t key) { + if (key >= 0) { + keysInUse.insert(key); + } + }); + fKeysCount = static_cast(keysInUse.size()); + } + int32_t keysCount = fUsePoolBundle->fKeysCount + fKeysCount; - if (U_FAILURE(errorCode) || fKeysCount == 0 || fKeyMap != NULL) { + if (U_FAILURE(errorCode) || fKeyMap != NULL) { return; } map = (KeyMapEntry *)uprv_malloc(keysCount * sizeof(KeyMapEntry)); @@ -1356,11 +1388,23 @@ SRBRoot::compactKeys(UErrorCode &errorCode) { ++keys; /* skip the NUL */ } keys = fKeys + fKeysBottom; - for (; i < keysCount; ++i) { - map[i].oldpos = (int32_t)(keys - fKeys); - map[i].newpos = 0; - while (*keys != 0) { ++keys; } /* skip the key */ - ++keys; /* skip the NUL */ + while (i < keysCount) { + int32_t keyOffset = static_cast(keys - fKeys); + if (!fIsPoolBundle && keysInUse.count(keyOffset) == 0) { + // Mark the unused key as deleted + while (*keys != 0) { *keys++ = 1; } + *keys++ = 1; + } else { + map[i].oldpos = keyOffset; + map[i].newpos = 0; + while (*keys != 0) { ++keys; } /* skip the key */ + ++keys; /* skip the NUL */ + i++; + } + } + if (keys != fKeys + fKeysTop) { + // Throw away any unused keys from the end + fKeysTop = static_cast(keys - fKeys); } /* Sort the keys so that each one is immediately followed by all of its suffixes. */ uprv_sortArray(map, keysCount, (int32_t)sizeof(KeyMapEntry), @@ -1403,7 +1447,7 @@ SRBRoot::compactKeys(UErrorCode &errorCode) { for (k = keyLimit; suffix < suffixLimit && *--k == *--suffixLimit;) {} if (suffix == suffixLimit && *k == *suffixLimit) { map[j].newpos = map[i].oldpos + offset; /* yes, point to the earlier key */ - /* mark the suffix as deleted */ + // Mark the suffix as deleted while (*suffix != 0) { *suffix++ = 1; } *suffix = 1; } else { @@ -1437,7 +1481,7 @@ SRBRoot::compactKeys(UErrorCode &errorCode) { keys[newpos++] = keys[oldpos++]; } } - assert(i == keysCount); + U_ASSERT(i == keysCount); } fKeysTop = newpos; /* Re-sort once more, by old offsets for binary searching. */ @@ -1691,3 +1735,55 @@ SRBRoot::compactStringsV2(UHashtable *stringSet, UErrorCode &errorCode) { // +1 to account for the initial zero in f16BitUnits assert(f16BitUnits.length() <= (f16BitStringsLength + 1)); } + +void SResource::applyFilter( + const PathFilter& /*filter*/, + ResKeyPath& /*path*/, + const SRBRoot* /*bundle*/) { + // Only a few resource types (tables) are capable of being filtered. +} + +void TableResource::applyFilter( + const PathFilter& filter, + ResKeyPath& path, + const SRBRoot* bundle) { + SResource* prev = nullptr; + SResource* curr = fFirst; + for (; curr != nullptr;) { + path.push(curr->getKeyString(bundle)); + auto inclusion = filter.match(path); + if (inclusion == PathFilter::EInclusion::INCLUDE) { + // Include whole subtree + // no-op + if (isVerbose()) { + std::cout << "genrb subtree: " << bundle->fLocale << ": INCLUDE: " << path << std::endl; + } + } else if (inclusion == PathFilter::EInclusion::EXCLUDE) { + // Reject the whole subtree + // Remove it from the linked list + if (isVerbose()) { + std::cout << "genrb subtree: " << bundle->fLocale << ": DELETE: " << path << std::endl; + } + if (prev == nullptr) { + fFirst = curr->fNext; + } else { + prev->fNext = curr->fNext; + } + fCount--; + delete curr; + curr = prev; + } else { + U_ASSERT(inclusion == PathFilter::EInclusion::PARTIAL); + // Recurse into the child + curr->applyFilter(filter, path, bundle); + } + path.pop(); + + prev = curr; + if (curr == nullptr) { + curr = fFirst; + } else { + curr = curr->fNext; + } + } +} diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.h b/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.h index ee1ecf3d05f..07874fdbaa8 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.h +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/reslist.h @@ -23,6 +23,8 @@ #define KEY_SPACE_SIZE 65536 #define RESLIST_MAX_INT_VECTOR 2048 +#include + #include "unicode/utypes.h" #include "unicode/unistr.h" #include "unicode/ures.h" @@ -36,7 +38,9 @@ U_CDECL_BEGIN +class PathFilter; class PseudoListResource; +class ResKeyPath; struct ResFile { ResFile() @@ -212,6 +216,19 @@ struct SResource { void write(UNewDataMemory *mem, uint32_t *byteOffset); virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset); + /** + * Applies the given filter with the given base path to this resource. + * Removes child resources rejected by the filter recursively. + * + * @param bundle Needed in order to access the key for this and child resources. + */ + virtual void applyFilter(const PathFilter& filter, ResKeyPath& path, const SRBRoot* bundle); + + /** + * Calls the given function for every key ID present in this tree. + */ + virtual void collectKeys(std::function collector) const; + int8_t fType; /* nominal type: fRes (when != 0xffffffff) may use subtype */ UBool fWritten; /* res_write() can exit early */ uint32_t fRes; /* resource item word; RES_BOGUS=0xffffffff if not known yet */ @@ -231,7 +248,10 @@ public: fCount(0), fFirst(NULL) {} virtual ~ContainerResource(); - virtual void handlePreflightStrings(SRBRoot *bundle, UHashtable *stringSet, UErrorCode &errorCode); + void handlePreflightStrings(SRBRoot *bundle, UHashtable *stringSet, UErrorCode &errorCode) override; + + void collectKeys(std::function collector) const override; + protected: void writeAllRes16(SRBRoot *bundle); void preWriteAllRes(uint32_t *byteOffset); @@ -254,9 +274,11 @@ public: void add(SResource *res, int linenumber, UErrorCode &errorCode); - virtual void handleWrite16(SRBRoot *bundle); - virtual void handlePreWrite(uint32_t *byteOffset); - virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset); + void handleWrite16(SRBRoot *bundle) override; + void handlePreWrite(uint32_t *byteOffset) override; + void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset) override; + + void applyFilter(const PathFilter& filter, ResKeyPath& path, const SRBRoot* bundle) override; int8_t fTableType; // determined by table_write16() for table_preWrite() & table_write() SRBRoot *fRoot; diff --git a/Build/source/libs/icu/icu-src/source/tools/genrb/rle.c b/Build/source/libs/icu/icu-src/source/tools/genrb/rle.c index 91be0630665..279684aad03 100644 --- a/Build/source/libs/icu/icu-src/source/tools/genrb/rle.c +++ b/Build/source/libs/icu/icu-src/source/tools/genrb/rle.c @@ -91,14 +91,14 @@ encodeRunByte(uint16_t* buffer,uint16_t* bufLimit, uint8_t value, int32_t length return buffer; } -#define APPEND( buffer, bufLimit, value, num, status){ \ +#define APPEND( buffer, bufLimit, value, num, status) UPRV_BLOCK_MACRO_BEGIN { \ if(buffer - - - {631C23CE-6C1D-4875-88F0-85E0A42B36EA} - Application false MultiByte + + + @@ -34,193 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - + + - .\x86\Release/gensprep.tlb + $(OutDir)\gensprep.tlb - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - false - true - .\x86\Release/gensprep.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + false + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)\gensprep.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\gensprep.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/gensprep.exe - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/gensprep.pdb Console - false - - + $(OutDir)\gensprep.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Debug/gensprep.tlb - + + + - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks + true MultiThreadedDebugDLL - true - false - true - .\x86\Debug/gensprep.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/gensprep.exe - true icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/gensprep.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Release/gensprep.tlb - + + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - false - true - .\x64\Release/gensprep.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/gensprep.exe - true icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/gensprep.pdb - Console - MachineX64 - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - X64 - .\x64\Debug/gensprep.tlb - - - Disabled - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - false - true - .\x64\Debug/gensprep.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/gensprep.exe - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/gensprep.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/gensprep/store.c b/Build/source/libs/icu/icu-src/source/tools/gensprep/store.c index 60252b9b903..3d75a39cc8c 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gensprep/store.c +++ b/Build/source/libs/icu/icu-src/source/tools/gensprep/store.c @@ -464,7 +464,8 @@ storeMapping(uint32_t codepoint, uint32_t* mapping,int32_t length, extern void -storeRange(uint32_t start, uint32_t end, UStringPrepType type,UErrorCode* status){ +storeRange(uint32_t start, uint32_t end, UStringPrepType type, UErrorCode* status){ + (void)status; // suppress compiler warnings about unused variable uint16_t trieWord = 0; if((int)(_SPREP_TYPE_THRESHOLD + type) > 0xFFFF){ diff --git a/Build/source/libs/icu/icu-src/source/tools/gentest/gentest.vcxproj b/Build/source/libs/icu/icu-src/source/tools/gentest/gentest.vcxproj index 4104b485974..2c6c7685dde 100644 --- a/Build/source/libs/icu/icu-src/source/tools/gentest/gentest.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/gentest/gentest.vcxproj @@ -1,18 +1,17 @@  - - - {77C78066-746F-4EA6-B3FE-B8C8A4A97891} gentest - Application false MultiByte + + + @@ -35,175 +34,55 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Release\ - .\x86\Release\ - false - .\x86\Debug\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + + - .\x86\Release/gentest.tlb + $(OutDir)/gentest.tlb - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - true - .\x86\Release/gentest.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + true + ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) + $(OutDir)/gentest.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/gentest.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Release/gentest.exe - true - icuuc.lib;icutest.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/gentest.pdb Console - false - - + $(OutDir)/gentest.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) + $(OutDir)/gentest.pdb - - - .\x86\Debug/gentest.tlb - + + - Disabled - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x86\Debug/gentest.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x86\Debug/gentest.exe - true icuucd.lib;icutestd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/gentest.pdb - Console - false - - - - - X64 - .\x64\Release/gentest.tlb - + + - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true MultiThreadedDLL true - true - true - .\x64\Release/gentest.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - .\x64\Release/gentest.exe - true icuuc.lib;icutest.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/gentest.pdb - Console - MachineX64 - - - - - X64 - .\x64\Debug/gentest.tlb - - - Disabled - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x64\Debug/gentest.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - .\x64\Debug/gentest.exe - true - icuucd.lib;icutestd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\x64\Debug/gentest.pdb - Console - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/icu-file-utf8-check.py b/Build/source/libs/icu/icu-src/source/tools/icu-file-utf8-check.py index 41b5a7b3f89..86de259e883 100755 --- a/Build/source/libs/icu/icu-src/source/tools/icu-file-utf8-check.py +++ b/Build/source/libs/icu/icu-src/source/tools/icu-file-utf8-check.py @@ -23,6 +23,8 @@ # Only files from the ICU github repository are checked. # No changes are made to the repository; only the working copy will be altered. +from __future__ import print_function + import sys import os import os.path @@ -35,13 +37,13 @@ def runCommand(cmd): output_text = output_file.read(); exit_status = output_file.close(); if exit_status: - print >>sys.stderr, '"', cmd, '" failed. Exiting.' + print('"', cmd, '" failed. Exiting.', file=sys.stderr) sys.exit(exit_status) return output_text def usage(): - print "usage: " + sys.argv[0] + " [-h | --help]" + print("usage: " + sys.argv[0] + " [-h | --help]") # @@ -50,7 +52,7 @@ def usage(): # is_source: Flag, set to True if file is a source code file (.c, .cpp, .h, .java). # def check_file(file_name, is_source): - f = open(file_name, 'r') + f = open(file_name, 'rb') bytes = f.read() f.close() @@ -58,13 +60,13 @@ def check_file(file_name, is_source): try: bytes.decode("UTF-8") except UnicodeDecodeError: - print "Error: %s is a source code file but contains non-utf-8 bytes." % file_name + print("Error: %s is a source code file but contains non-utf-8 bytes." % file_name) - if ord(bytes[0]) == 0xef: + if bytes[0] == 0xef: if not (file_name.endswith(".txt") or file_name.endswith(".sln") or file_name.endswith(".targets") or ".vcxproj" in file_name): - print "Warning: file %s contains a UTF-8 BOM: " % file_name + print("Warning: file %s contains a UTF-8 BOM: " % file_name) return @@ -72,7 +74,7 @@ def main(argv): try: opts, args = getopt.getopt(argv, "h", ("help")) except getopt.GetoptError: - print "unrecognized option: " + argv[0] + print("unrecognized option: " + argv[0]) usage() sys.exit(2) for opt, arg in opts: @@ -80,7 +82,7 @@ def main(argv): usage() sys.exit() if args: - print "unexpected command line argument" + print("unexpected command line argument") usage() sys.exit() @@ -91,10 +93,10 @@ def main(argv): for f in file_list: if os.path.isdir(f): - print "Skipping dir " + f + print("Skipping dir " + f) continue if not os.path.isfile(f): - print "Repository file not in working copy: " + f + print("Repository file not in working copy: " + f) continue; source_file = source_file_re.match(f) diff --git a/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.cpp b/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.cpp index 08bd87b85db..fee17cf685c 100644 --- a/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.cpp @@ -84,6 +84,12 @@ void cmd_version(UBool /* noLoad */, UErrorCode &errorCode) errorCode=U_INTERNAL_PROGRAM_ERROR; } +#if defined(_MSC_VER) +// Ignore warning 4127, conditional expression is constant. This is intentional below. +#pragma warning(push) +#pragma warning(disable: 4127) +#endif + if(U_SIZEOF_WCHAR_T==sizeof(wchar_t)) { //printf("U_SIZEOF_WCHAR_T: %d\n", U_SIZEOF_WCHAR_T); } else { @@ -108,6 +114,10 @@ void cmd_version(UBool /* noLoad */, UErrorCode &errorCode) errorCode=U_INTERNAL_PROGRAM_ERROR; } +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + printf("\n\nICU Initialization returned: %s\n", u_errorName(initStatus)); diff --git a/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.vcxproj b/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.vcxproj index ba332864a71..78ac7fa1ef8 100644 --- a/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/icuinfo/icuinfo.vcxproj @@ -1,17 +1,16 @@  - - - {E7611F49-F088-4175-9446-6111444E72C8} - Application false MultiByte + + + @@ -34,125 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - x86\Release\ - x86\Release\ - false - x86\Debug\ - x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + + + $(OutDir)\icuinfo.tlb + - ..\..\common;..\..\i18n;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - true Level4 - - - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - - - MultiThreadedDLL - true - x86\Release/icuinfo.pch - x86\Release/ - x86\Release/ - x86\Release/ Default + false + ..\..\common;..\..\i18n;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) + $(OutDir)\icuinfo.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\icuinfo.pdb - $(OutDir)icuinfo.exe - icuuc.lib;icuin.lib;icutu.lib;icutest.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - x86\Release/icuinfo.pdb Console - false - - + $(OutDir)\icuinfo.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) + + + - MultiThreadedDebugDLL - Debug/icuinfo.pch - Debug/ - Debug/ - Debug/ true - EditAndContinue - Default + MultiThreadedDebugDLL - $(OutDir)icuinfo.exe icuucd.lib;icuind.lib;icutud.lib;icutestd.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - $(OutDir)icuinfo.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - + + MultiThreadedDLL true - x64\Release/icuinfo.pch - x64\Release/ - x64\Release/ - x64\Release/ - Default - $(OutDir)icuinfo.exe icuuc.lib;icuin.lib;icutu.lib;icutest.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - x64\Release/icuinfo.pdb - Console - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - MultiThreadedDebugDLL - Debug/icuinfo.pch - Debug/ - Debug/ - Debug/ - true - ProgramDatabase - Default - - - $(OutDir)icuinfo.exe - icuucd.lib;icuind.lib;icutud.lib;icutestd.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - $(OutDir)icuinfo.pdb - Console diff --git a/Build/source/libs/icu/icu-src/source/tools/icuinfo/testplug.vcxproj b/Build/source/libs/icu/icu-src/source/tools/icuinfo/testplug.vcxproj index 058c495322d..ca81f1a7698 100644 --- a/Build/source/libs/icu/icu-src/source/tools/icuinfo/testplug.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/icuinfo/testplug.vcxproj @@ -1,17 +1,16 @@  - - - {659D0C08-D4ED-4BF3-B02B-2D8D4B5A7A7A} - DynamicLibrary false MultiByte + + + @@ -34,195 +33,61 @@ <_ProjectFileVersion>10.0.30319.1 - .\..\..\..\lib\ - .\x86\Release-testplug\ - false - .\..\..\..\lib\ - .\x86\Debug-testplug\ - true - .\x64\Release-testplug\ - .\x64\Release-testplug\ - false - .\x64\Debug-testplug\ - .\x64\Debug-testplug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + + - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\..\lib\testplug.tlb + $(OutDir)\testplug.tlb - true ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;T_CTEST_IMPLEMENTATION;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true + T_CTEST_IMPLEMENTATION;%(PreprocessorDefinitions) true - true - .\x86\Release-testplug/testplug.pch - .\x86\Release-testplug/ - .\x86\Release-testplug/ - .\x86\Release-testplug/ Level3 - true Default - /utf-8 %(AdditionalOptions) - true + ProgramDatabase + $(OutDir)\testplug.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\testplug.pdb - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - ..\..\..\bin\testplug.dll - true - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\..\..\..\lib\testplug.pdb - true - UseLinkTimeCodeGeneration - false - - - .\..\..\..\lib\testplug.lib + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\..\..\..\lib\testplugd.tlb - + + - Disabled - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;T_CTEST_IMPLEMENTATION;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x86\Debug-testplug/testplug.pch - .\x86\Debug-testplug/ - .\x86\Debug-testplug/ - .\x86\Debug-testplug/ true - Level3 - true - EditAndContinue - Default - /utf-8 %(AdditionalOptions) - true + MultiThreadedDebugDLL - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - ..\..\..\bin\testplug.dll - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) true - .\..\..\..\lib\testplugd.pdb - false - - - .\..\..\..\lib\testplugd.lib + ..\..\..\$(IcuBinOutputDir)\testplugd.dll + ..\..\..\$(IcuLibOutputDir)\testplugd.pdb + ..\..\..\$(IcuLibOutputDir)\testplugd.lib + icuucd.lib;icutud.lib;%(AdditionalDependencies) - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\..\..\..\lib64\testplug.tlb - + + - true - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;T_CTEST_IMPLEMENTATION;%(PreprocessorDefinitions) - true MultiThreadedDLL true - true - true - .\x64\Release-testplug/testplug.pch - .\x64\Release-testplug/ - .\x64\Release-testplug/ - .\x64\Release-testplug/ - Level3 - true - Default - /utf-8 %(AdditionalOptions) - true - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - ..\..\..\bin64\testplug.dll - true + ..\..\..\$(IcuBinOutputDir)\testplug.dll + ..\..\..\$(IcuLibOutputDir)\testplug.pdb + ..\..\..\$(IcuLibOutputDir)\testplug.lib icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\..\..\..\lib64\testplug.pdb - true - UseLinkTimeCodeGeneration - .\..\..\..\lib64\testplug.lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - .\..\..\..\lib64\testplugd.tlb - - - Disabled - ..\..\..\include;..\..\common;..\toolutil;..\ctestfw;%(AdditionalIncludeDirectories) - WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;T_CTEST_IMPLEMENTATION;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - .\x64\Debug-testplug/testplug.pch - .\x64\Debug-testplug/ - .\x64\Debug-testplug/ - .\x64\Debug-testplug/ - true - Level3 - true - ProgramDatabase - Default - /utf-8 %(AdditionalOptions) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ..\..\..\bin64\testplug.dll - true - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - true - .\..\..\..\lib64\testplugd.pdb - .\..\..\..\lib64\testplugd.lib - MachineX64 diff --git a/Build/source/libs/icu/icu-src/source/tools/icupkg/icupkg.vcxproj b/Build/source/libs/icu/icu-src/source/tools/icupkg/icupkg.vcxproj index f75d40a4077..1af31e079c4 100644 --- a/Build/source/libs/icu/icu-src/source/tools/icupkg/icupkg.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/icupkg/icupkg.vcxproj @@ -1,18 +1,16 @@  - - - {62D4B15D-7A90-4ECB-BA19-5E021D6A21BC} - Win32Proj - Application false MultiByte + + + @@ -35,126 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - x86\Release\ - x86\Release\ - false - x86\Debug\ - x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + + + $(OutDir)\icupkg.tlb + - ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - true Level4 - - - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - - - MultiThreadedDLL - true - x86\Release/icupkg.pch - x86\Release/ - x86\Release/ - x86\Release/ Default + true + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)\icupkg.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)\icupkg.pdb - $(OutDir)icupkg.exe - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - x86\Release/icupkg.pdb Console - false - - + $(OutDir)\icupkg.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) + + + - MultiThreadedDebugDLL - Debug/icupkg.pch - Debug/ - Debug/ - Debug/ true - EditAndContinue - Default + MultiThreadedDebugDLL - $(OutDir)icupkg.exe icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - $(OutDir)icupkg.pdb - Console - false - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - + + MultiThreadedDLL true - x64\Release/icupkg.pch - x64\Release/ - x64\Release/ - x64\Release/ - Default - $(OutDir)icupkg.exe icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - x64\Release/icupkg.pdb - Console - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - MultiThreadedDebugDLL - Debug/icupkg.pch - Debug/ - Debug/ - Debug/ - true - ProgramDatabase - Default - - - $(OutDir)icupkg.exe - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - $(OutDir)icupkg.pdb - Console diff --git a/Build/source/libs/icu/icu-src/source/tools/makeconv/gencnvex.c b/Build/source/libs/icu/icu-src/source/tools/makeconv/gencnvex.c index dcc849d8eda..726a1e5a86d 100644 --- a/Build/source/libs/icu/icu-src/source/tools/makeconv/gencnvex.c +++ b/Build/source/libs/icu/icu-src/source/tools/makeconv/gencnvex.c @@ -107,12 +107,17 @@ CnvExtClose(NewConverter *cnvData) { static UBool CnvExtIsValid(NewConverter *cnvData, const uint8_t *bytes, int32_t length) { + // suppress compiler warnings about unused variables + (void)cnvData; + (void)bytes; + (void)length; return FALSE; } static uint32_t CnvExtWrite(NewConverter *cnvData, const UConverterStaticData *staticData, UNewDataMemory *pData, int32_t tableType) { + (void) staticData; // suppress compiler warnings about unused variable CnvExtData *extData=(CnvExtData *)cnvData; int32_t length, top, headerSize; @@ -121,7 +126,7 @@ CnvExtWrite(NewConverter *cnvData, const UConverterStaticData *staticData, if(tableType&TABLE_BASE) { headerSize=0; } else { - _MBCSHeader header={ { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0 }; + _MBCSHeader header={ { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* write the header and base table name for an extension-only table */ length=(int32_t)uprv_strlen(extData->ucm->baseName)+1; diff --git a/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.cpp b/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.cpp index 5a01e209152..37dc46203f1 100644 --- a/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.cpp @@ -179,6 +179,7 @@ enum { OPT_SMALL, OPT_IGNORE_SISO_CHECK, OPT_QUIET, + OPT_SOURCEDIR, OPT_COUNT }; @@ -193,6 +194,7 @@ static UOption options[]={ { "small", NULL, NULL, NULL, '\1', UOPT_NO_ARG, 0 }, { "ignore-siso-check", NULL, NULL, NULL, '\1', UOPT_NO_ARG, 0 }, UOPTION_QUIET, + UOPTION_SOURCEDIR, }; int main(int argc, char* argv[]) @@ -230,7 +232,8 @@ int main(int argc, char* argv[]) "\t-c or --copyright include a copyright notice\n" "\t-d or --destdir destination directory, followed by the path\n" "\t-v or --verbose Turn on verbose output\n" - "\t-q or --quiet do not display warnings and progress\n", + "\t-q or --quiet do not display warnings and progress\n" + "\t-s or --sourcedir source directory, followed by the path\n", argv[0]); fprintf(stdfile, "\t --small Generate smaller .cnv files. They will be\n" @@ -282,11 +285,20 @@ int main(int argc, char* argv[]) #endif UBool printFilename = (UBool) (argc > 2 || VERBOSE); + icu::CharString pathBuf; for (++argv; --argc; ++argv) { UErrorCode localError = U_ZERO_ERROR; const char *arg = getLongPathname(*argv); + const char* sourcedir = options[OPT_SOURCEDIR].value; + if (sourcedir != NULL && *sourcedir != 0 && uprv_strcmp(sourcedir, ".") != 0) { + pathBuf.clear(); + pathBuf.appendPathPart(sourcedir, localError); + pathBuf.appendPathPart(arg, localError); + arg = pathBuf.data(); + } + /*produces the right destination path for display*/ outFileName.truncate(outBasenameStart); if (outBasenameStart != 0) diff --git a/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.vcxproj b/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.vcxproj index b5a15279e6c..73c94a7c289 100644 --- a/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/makeconv/makeconv.vcxproj @@ -1,17 +1,16 @@  - - - {F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C} - Application false MultiByte + + + @@ -34,135 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Debug\ - .\x86\Debug\ - true - .\x86\Release\ - .\x86\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + - - ..\..\..\include;..\..\common;..\toolutil;%(AdditionalIncludeDirectories) - false - Level3 - - - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - - .\x86\Debug/makeconv.tlb + $(OutDir)/makeconv.tlb - MultiThreadedDebugDLL - .\x86\Debug/makeconv.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ - true - EditAndContinue + Level3 Default + false + ..\..\..\include;..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/makeconv.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/makeconv.pdb - .\x86\Debug/makeconv.exe - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Debug/makeconv.pdb Console - false - - + $(OutDir)/makeconv.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Release/makeconv.tlb - - - MultiThreadedDLL - .\x86\Release/makeconv.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ - Default - - - .\x86\Release/makeconv.exe - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/makeconv.pdb - Console - false - - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - .\x64\Debug/makeconv.tlb - + + - MultiThreadedDebugDLL - .\x64\Debug/makeconv.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ true - ProgramDatabase - Default + MultiThreadedDebugDLL - .\x64\Debug/makeconv.exe icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Debug/makeconv.pdb - Console - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - .\x64\Release/makeconv.tlb - + + MultiThreadedDLL - .\x64\Release/makeconv.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Default + true - .\x64\Release/makeconv.exe icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/makeconv.pdb - Console diff --git a/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.cpp b/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.cpp index b2cd0ab5eb9..1f318ac0f3a 100644 --- a/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.cpp @@ -122,8 +122,9 @@ enum { QUIET, WITHOUT_ASSEMBLY, PDS_BUILD, - UWP_BUILD, - UWP_ARM_BUILD + WIN_UWP_BUILD, + WIN_DLL_ARCH, + WIN_DYNAMICBASE }; /* This sets the modes that are available */ @@ -167,7 +168,8 @@ static UOption options[]={ /*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG), /*21*/ UOPTION_DEF("zos-pds-build", 'z', UOPT_NO_ARG), /*22*/ UOPTION_DEF("windows-uwp-build", 'u', UOPT_NO_ARG), - /*23*/ UOPTION_DEF("windows-uwp-arm-build", 'a', UOPT_NO_ARG) + /*23*/ UOPTION_DEF("windows-DLL-arch", 'a', UOPT_REQUIRES_ARG), + /*24*/ UOPTION_DEF("windows-dynamicbase", 'b', UOPT_NO_ARG), }; /* This enum and the following char array should be kept in sync. */ @@ -258,7 +260,8 @@ const char options_help[][320]={ "Build the data without assembly code", "Build PDS dataset (zOS build only)", "Build for Universal Windows Platform (Windows build only)", - "Set DLL machine type for UWP to target windows ARM (Windows UWP build only)" + "Specify the DLL machine architecture for LINK.exe (Windows build only)", + "Ignored. Enable DYNAMICBASE on the DLL. This is now the default. (Windows build only)", }; const char *progname = "PKGDATA"; @@ -468,6 +471,10 @@ main(int argc, char* argv[]) { #endif } + if (options[WIN_DYNAMICBASE].doesOccur) { + fprintf(stdout, "Note: Ignoring option -b (windows-dynamicbase).\n"); + } + /* OK options are set up. Now the file lists. */ tail = NULL; for( n=1; n3) && checkAssemblyHeaderName(genccodeAssembly+3)) { - writeAssemblyCode(datFileNamePath, o->tmpDir, o->entryName, NULL, gencFilePath); + writeAssemblyCode( + datFileNamePath, + o->tmpDir, + o->entryName, + NULL, + gencFilePath, + sizeof(gencFilePath)); result = pkg_createWithAssemblyCode(targetDir, mode, gencFilePath); if (result != 0) { @@ -753,7 +766,14 @@ static int32_t pkg_executeOptions(UPKGOptions *o) { /* Try to detect the arch type, use NULL if unsuccessful */ char optMatchArch[10] = { 0 }; pkg_createOptMatchArch(optMatchArch); - writeObjectCode(datFileNamePath, o->tmpDir, o->entryName, (optMatchArch[0] == 0 ? NULL : optMatchArch), NULL, gencFilePath); + writeObjectCode( + datFileNamePath, + o->tmpDir, + o->entryName, + (optMatchArch[0] == 0 ? NULL : optMatchArch), + NULL, + gencFilePath, + sizeof(gencFilePath)); pkg_destroyOptMatchArch(optMatchArch); #if U_PLATFORM_IS_LINUX_BASED result = pkg_generateLibraryFile(targetDir, mode, gencFilePath); @@ -1350,8 +1370,8 @@ static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, c if (IN_STATIC_MODE(mode)) { if (cmd == NULL) { - length = uprv_strlen(pkgDataFlags[AR]) + uprv_strlen(pkgDataFlags[ARFLAGS]) + uprv_strlen(targetDir) + - uprv_strlen(libFileNames[LIB_FILE_VERSION]) + uprv_strlen(objectFile) + uprv_strlen(pkgDataFlags[RANLIB]) + BUFFER_PADDING_SIZE; + length = static_cast(uprv_strlen(pkgDataFlags[AR]) + uprv_strlen(pkgDataFlags[ARFLAGS]) + uprv_strlen(targetDir) + + uprv_strlen(libFileNames[LIB_FILE_VERSION]) + uprv_strlen(objectFile) + uprv_strlen(pkgDataFlags[RANLIB]) + BUFFER_PADDING_SIZE); if ((cmd = (char *)uprv_malloc(sizeof(char) * length)) == NULL) { fprintf(stderr, "Unable to allocate memory for command.\n"); return -1; @@ -1376,15 +1396,15 @@ static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, c } } else /* if (IN_DLL_MODE(mode)) */ { if (cmd == NULL) { - length = uprv_strlen(pkgDataFlags[GENLIB]) + uprv_strlen(pkgDataFlags[LDICUDTFLAGS]) + + length = static_cast(uprv_strlen(pkgDataFlags[GENLIB]) + uprv_strlen(pkgDataFlags[LDICUDTFLAGS]) + ((uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_VERSION_TMP])) * 2) + uprv_strlen(objectFile) + uprv_strlen(pkgDataFlags[LD_SONAME]) + uprv_strlen(pkgDataFlags[LD_SONAME][0] == 0 ? "" : libFileNames[LIB_FILE_VERSION_MAJOR]) + - uprv_strlen(pkgDataFlags[RPATH_FLAGS]) + uprv_strlen(pkgDataFlags[BIR_FLAGS]) + BUFFER_PADDING_SIZE; + uprv_strlen(pkgDataFlags[RPATH_FLAGS]) + uprv_strlen(pkgDataFlags[BIR_FLAGS]) + BUFFER_PADDING_SIZE); #if U_PLATFORM == U_PF_CYGWIN - length += uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_CYGWIN_VERSION]); + length += static_cast(uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_CYGWIN_VERSION])); #elif U_PLATFORM == U_PF_MINGW - length += uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_MINGW]); + length += static_cast(uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_MINGW])); #endif if ((cmd = (char *)uprv_malloc(sizeof(char) * length)) == NULL) { fprintf(stderr, "Unable to allocate memory for command.\n"); @@ -1516,8 +1536,8 @@ static int32_t pkg_createWithAssemblyCode(const char *targetDir, const char mode uprv_strcpy(tempObjectFile, gencFilePath); tempObjectFile[uprv_strlen(tempObjectFile)-1] = 'o'; - length = uprv_strlen(pkgDataFlags[COMPILER]) + uprv_strlen(pkgDataFlags[LIBFLAGS]) - + uprv_strlen(tempObjectFile) + uprv_strlen(gencFilePath) + BUFFER_PADDING_SIZE; + length = static_cast(uprv_strlen(pkgDataFlags[COMPILER]) + uprv_strlen(pkgDataFlags[LIBFLAGS]) + + uprv_strlen(tempObjectFile) + uprv_strlen(gencFilePath) + BUFFER_PADDING_SIZE); cmd = (char *)uprv_malloc(sizeof(char) * length); if (cmd == NULL) { @@ -1685,7 +1705,13 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD printf("# Generating %s \n", gencmnFile); } - writeCCode(file, o->tmpDir, dataName[0] != 0 ? dataName : o->shortName, newName[0] != 0 ? newName : NULL, gencmnFile); + writeCCode( + file, + o->tmpDir, + dataName[0] != 0 ? dataName : o->shortName, + newName[0] != 0 ? newName : NULL, + gencmnFile, + sizeof(gencmnFile)); #ifdef USE_SINGLE_CCODE_FILE sprintf(cmd, "#include \"%s\"\n", gencmnFile); @@ -1758,14 +1784,12 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD #ifdef WINDOWS_WITH_MSVC #define LINK_CMD "link.exe /nologo /release /out:" -#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /implib:" -#ifdef _WIN64 -#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /DYNAMICBASE /APPCONTAINER " -#else -#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /SAFESEH /DYNAMICBASE /APPCONTAINER /MACHINE:X86" -#endif -#define LINK_EXTRA_UWP_FLAGS_ARM "/NXCOMPAT /DYNAMICBASE /APPCONTAINER /MACHINE:ARM" -#define LINK_EXTRA_NO_UWP_FLAGS "/base:0x4ad00000 " +#define LINK_FLAGS "/NXCOMPAT /DYNAMICBASE /DLL /NOENTRY /MANIFEST:NO /implib:" + +#define LINK_EXTRA_UWP_FLAGS "/APPCONTAINER " +#define LINK_EXTRA_UWP_FLAGS_X86_ONLY "/SAFESEH " + +#define LINK_EXTRA_FLAGS_MACHINE "/MACHINE:" #define LIB_CMD "LIB.exe /nologo /out:" #define LIB_FILE "icudt.lib" #define LIB_EXT UDATA_LIB_SUFFIX @@ -1845,23 +1869,23 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U return 0; } - char *extraFlags = ""; + char extraFlags[SMALL_BUFFER_MAX_SIZE] = ""; #ifdef WINDOWS_WITH_MSVC - if (options[UWP_BUILD].doesOccur) - { - if (options[UWP_ARM_BUILD].doesOccur) - { - extraFlags = LINK_EXTRA_UWP_FLAGS_ARM; - } - else - { - extraFlags = LINK_EXTRA_UWP_FLAGS; + if (options[WIN_UWP_BUILD].doesOccur) { + uprv_strcat(extraFlags, LINK_EXTRA_UWP_FLAGS); + + if (options[WIN_DLL_ARCH].doesOccur) { + if (uprv_strcmp(options[WIN_DLL_ARCH].value, "X86") == 0) { + uprv_strcat(extraFlags, LINK_EXTRA_UWP_FLAGS_X86_ONLY); + } } } - else - { - extraFlags = LINK_EXTRA_NO_UWP_FLAGS; + + if (options[WIN_DLL_ARCH].doesOccur) { + uprv_strcat(extraFlags, LINK_EXTRA_FLAGS_MACHINE); + uprv_strcat(extraFlags, options[WIN_DLL_ARCH].value); } + #endif sprintf(cmd, "%s\"%s\" %s %s\"%s\" \"%s\" %s", LINK_CMD, @@ -1905,7 +1929,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) { char *tmpGenlibFlagBuffer = NULL; int32_t i, offset; - length = uprv_strlen(flag) + 1; + length = static_cast(uprv_strlen(flag) + 1); tmpGenlibFlagBuffer = (char *)uprv_malloc(length); if (tmpGenlibFlagBuffer == NULL) { /* Memory allocation error */ @@ -1915,7 +1939,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) { uprv_strcpy(tmpGenlibFlagBuffer, flag); - offset = uprv_strlen(rm_cmd); + offset = static_cast(uprv_strlen(rm_cmd)); for (i = 0; i < (length - offset); i++) { flag[i] = tmpGenlibFlagBuffer[offset + i]; @@ -1928,7 +1952,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) { } flag = pkgDataFlags[BIR_FLAGS]; - length = uprv_strlen(pkgDataFlags[BIR_FLAGS]); + length = static_cast(uprv_strlen(pkgDataFlags[BIR_FLAGS])); for (int32_t i = 0; i < length; i++) { if (flag[i] == MAP_FILE_EXT[count]) { @@ -1988,7 +2012,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) { int32_t length = 0; flag = pkgDataFlags[GENLIB]; - length = uprv_strlen(pkgDataFlags[GENLIB]); + length = static_cast(uprv_strlen(pkgDataFlags[GENLIB])); int32_t position = length - 1; @@ -2006,7 +2030,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) { int32_t length = 0; flag = pkgDataFlags[GENLIB]; - length = uprv_strlen(pkgDataFlags[GENLIB]); + length = static_cast(uprv_strlen(pkgDataFlags[GENLIB])); int32_t position = length - 1; @@ -2117,8 +2141,8 @@ static void loadLists(UPKGOptions *o, UErrorCode *status) fprintf(stderr, "pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, s); exit(U_ILLEGAL_ARGUMENT_ERROR); } - tmpLength = uprv_strlen(o->srcDir) + - uprv_strlen(s) + 5; /* 5 is to add a little extra space for, among other things, PKGDATA_FILE_SEP_STRING */ + /* The +5 is to add a little extra space for, among other things, PKGDATA_FILE_SEP_STRING */ + tmpLength = static_cast(uprv_strlen(o->srcDir) + uprv_strlen(s) + 5); if((tmp = (char *)uprv_malloc(tmpLength)) == NULL) { fprintf(stderr, "pkgdata: Error: Unable to allocate tmp buffer size: %d\n", tmpLength); exit(U_MEMORY_ALLOCATION_ERROR); diff --git a/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.vcxproj b/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.vcxproj index 680cc2f799b..f2efdbd6b8f 100644 --- a/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/pkgdata/pkgdata.vcxproj @@ -1,17 +1,16 @@  - - - {4C8454FE-81D3-4CA3-9927-29BA96F03DAC} - Application false MultiByte + + + @@ -34,151 +33,58 @@ <_ProjectFileVersion>10.0.30319.1 - .\x86\Debug\ - .\x86\Debug\ - true - .\x86\Release\ - .\x86\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false - + - - ../../../include;../../common;../toolutil;%(AdditionalIncludeDirectories) - true - Level3 - - - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) - - .\x86\Debug/pkgdata.tlb + $(OutDir)/pkgdata.tlb - MultiThreadedDebugDLL - .\x86\Debug/pkgdata.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ - true - EditAndContinue + Level3 Default + true + ../../../include;../../common;../toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/pkgdata.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/pkgdata.pdb - - 0x0411 - - .\x86\Debug/pkgdata.exe - icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - true - .\x86\Debug/pkgdata.pdb Console - false - - + $(OutDir)/pkgdata.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) - - - copy "$(TargetPath)" ..\..\..\bin - - ..\..\..\bin\$(TargetFileName);%(Outputs) + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) - - .\x86\Release/pkgdata.tlb - - - MultiThreadedDLL - true - .\x86\Release/pkgdata.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ - Default - - - 0x0411 - - - .\x86\Release/pkgdata.exe - icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) - .\x86\Release/pkgdata.pdb - Console - false - - - - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - .\x64\Debug/pkgdata.tlb - + + - MultiThreadedDebugDLL - .\x64\Debug/pkgdata.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ true - ProgramDatabase - Default + MultiThreadedDebugDLL - - 0x0411 - - .\x64\Debug/pkgdata.exe icuucd.lib;icutud.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Debug/pkgdata.pdb - Console - - - copy "$(TargetPath)" ..\..\..\bin64 - - ..\..\..\bin64\$(TargetFileName);%(Outputs) - - - .\x64\Release/pkgdata.tlb - + + MultiThreadedDLL true - .\x64\Release/pkgdata.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - true - Default - - 0x0411 - - .\x64\Release/pkgdata.exe icuuc.lib;icutu.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\x64\Release/pkgdata.pdb - Console diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/filetools.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/filetools.cpp index 6e88c94b520..0f0e9c59846 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/filetools.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/filetools.cpp @@ -65,7 +65,7 @@ isFileModTimeLater(const char *filePath, const char *checkAgainst, UBool isDir) if (U_FAILURE(status)) { fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, u_errorName(status)); return FALSE; - }; + } if ((subDirp = opendir(newpath.data())) != NULL) { /* If this new path is a directory, make a recursive call with the newpath. */ diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.cpp index 0cf7a57ee11..3f71e00cb64 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.cpp @@ -48,6 +48,8 @@ #include "uoptions.h" #include "pkg_genc.h" #include "filetools.h" +#include "charstr.h" +#include "unicode/errorcode.h" #define MAX_COLUMN ((uint32_t)(0xFFFFFFFFU)) @@ -56,7 +58,15 @@ /* prototypes --------------------------------------------------------------- */ static void -getOutFilename(const char *inFilename, const char *destdir, char *outFilename, char *entryName, const char *newSuffix, const char *optFilename); +getOutFilename( + const char *inFilename, + const char *destdir, + char *outFilename, + int32_t outFilenameCapacity, + char *entryName, + int32_t entryNameCapacity, + const char *newSuffix, + const char *optFilename); static uint32_t write8(FileStream *out, uint8_t byte, uint32_t column); @@ -259,13 +269,21 @@ printAssemblyHeadersToStdErr(void) { } U_CAPI void U_EXPORT2 -writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath) { +writeAssemblyCode( + const char *filename, + const char *destdir, + const char *optEntryPoint, + const char *optFilename, + char *outFilePath, + size_t outFilePathCapacity) { uint32_t column = MAX_COLUMN; - char entry[64]; - uint32_t buffer[1024]; - char *bufferStr = (char *)buffer; + char entry[96]; + union { + uint32_t uint32s[1024]; + char chars[4096]; + } buffer; FileStream *in, *out; - size_t i, length; + size_t i, length, count; in=T_FileStream_open(filename, "rb"); if(in==NULL) { @@ -273,15 +291,27 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr exit(U_FILE_ACCESS_ERROR); } - getOutFilename(filename, destdir, bufferStr, entry, ".S", optFilename); - out=T_FileStream_open(bufferStr, "w"); + getOutFilename( + filename, + destdir, + buffer.chars, + sizeof(buffer.chars), + entry, + sizeof(entry), + ".S", + optFilename); + out=T_FileStream_open(buffer.chars, "w"); if(out==NULL) { - fprintf(stderr, "genccode: unable to open output file %s\n", bufferStr); + fprintf(stderr, "genccode: unable to open output file %s\n", buffer.chars); exit(U_FILE_ACCESS_ERROR); } if (outFilePath != NULL) { - uprv_strcpy(outFilePath, bufferStr); + if (uprv_strlen(buffer.chars) >= outFilePathCapacity) { + fprintf(stderr, "genccode: filename too long\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } + uprv_strcpy(outFilePath, buffer.chars); } #if defined (WINDOWS_WITH_GNUC) && U_PLATFORM != U_PF_CYGWIN @@ -302,34 +332,42 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr } } - sprintf(bufferStr, assemblyHeader[assemblyHeaderIndex].header, + count = snprintf( + buffer.chars, sizeof(buffer.chars), + assemblyHeader[assemblyHeaderIndex].header, entry, entry, entry, entry, entry, entry, entry, entry); - T_FileStream_writeLine(out, bufferStr); + if (count >= sizeof(buffer.chars)) { + fprintf(stderr, "genccode: entry name too long (long filename?)\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } + T_FileStream_writeLine(out, buffer.chars); T_FileStream_writeLine(out, assemblyHeader[assemblyHeaderIndex].beginLine); for(;;) { - length=T_FileStream_read(in, buffer, sizeof(buffer)); + memset(buffer.uint32s, 0, sizeof(buffer.uint32s)); + length=T_FileStream_read(in, buffer.uint32s, sizeof(buffer.uint32s)); if(length==0) { break; } - if (length != sizeof(buffer)) { - /* pad with extra 0's when at the end of the file */ - for(i=0; i < (length % sizeof(uint32_t)); ++i) { - buffer[length+i] = 0; - } - } - for(i=0; i<(length/sizeof(buffer[0])); i++) { - column = write32(out, buffer[i], column); + for(i=0; i<(length/sizeof(buffer.uint32s[0])); i++) { + // TODO: What if the last read sees length not as a multiple of 4? + column = write32(out, buffer.uint32s[i], column); } } T_FileStream_writeLine(out, "\n"); - sprintf(bufferStr, assemblyHeader[assemblyHeaderIndex].footer, + count = snprintf( + buffer.chars, sizeof(buffer.chars), + assemblyHeader[assemblyHeaderIndex].footer, entry, entry, entry, entry, entry, entry, entry, entry); - T_FileStream_writeLine(out, bufferStr); + if (count >= sizeof(buffer.chars)) { + fprintf(stderr, "genccode: entry name too long (long filename?)\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } + T_FileStream_writeLine(out, buffer.chars); if(T_FileStream_error(in)) { fprintf(stderr, "genccode: file read error while generating from file %s\n", filename); @@ -346,11 +384,17 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr } U_CAPI void U_EXPORT2 -writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath) { +writeCCode( + const char *filename, + const char *destdir, + const char *optName, + const char *optFilename, + char *outFilePath, + size_t outFilePathCapacity) { uint32_t column = MAX_COLUMN; - char buffer[4096], entry[64]; + char buffer[4096], entry[96]; FileStream *in, *out; - size_t i, length; + size_t i, length, count; in=T_FileStream_open(filename, "rb"); if(in==NULL) { @@ -359,16 +403,35 @@ writeCCode(const char *filename, const char *destdir, const char *optName, const } if(optName != NULL) { /* prepend 'icudt28_' */ - strcpy(entry, optName); - strcat(entry, "_"); + // +2 includes the _ and the NUL + if (uprv_strlen(optName) + 2 > sizeof(entry)) { + fprintf(stderr, "genccode: entry name too long (long filename?)\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } + strcpy(entry, optName); + strcat(entry, "_"); } else { - entry[0] = 0; + entry[0] = 0; } - getOutFilename(filename, destdir, buffer, entry+uprv_strlen(entry), ".c", optFilename); + getOutFilename( + filename, + destdir, + buffer, + sizeof(buffer), + entry + uprv_strlen(entry), + sizeof(entry) - uprv_strlen(entry), + ".c", + optFilename); + if (outFilePath != NULL) { + if (uprv_strlen(buffer) >= outFilePathCapacity) { + fprintf(stderr, "genccode: filename too long\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } uprv_strcpy(outFilePath, buffer); } + out=T_FileStream_open(buffer, "w"); if(out==NULL) { fprintf(stderr, "genccode: unable to open output file %s\n", buffer); @@ -396,7 +459,7 @@ writeCCode(const char *filename, const char *destdir, const char *optName, const magic numbers we must still use the initial double. [grhoten 4/24/2003] */ - sprintf(buffer, + count = snprintf(buffer, sizeof(buffer), "#ifndef IN_GENERATED_CCODE\n" "#define IN_GENERATED_CCODE\n" "#define U_DISABLE_RENAMING 1\n" @@ -408,6 +471,10 @@ writeCCode(const char *filename, const char *destdir, const char *optName, const " const char *bytes; \n" "} %s={ 0.0, \n", entry); + if (count >= sizeof(buffer)) { + fprintf(stderr, "genccode: entry name too long (long filename?)\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } T_FileStream_writeLine(out, buffer); for(;;) { @@ -423,7 +490,7 @@ writeCCode(const char *filename, const char *destdir, const char *optName, const T_FileStream_writeLine(out, "\"\n};\nU_CDECL_END\n"); #else /* Function renaming shouldn't be done in data */ - sprintf(buffer, + count = snprintf(buffer, sizeof(buffer), "#ifndef IN_GENERATED_CCODE\n" "#define IN_GENERATED_CCODE\n" "#define U_DISABLE_RENAMING 1\n" @@ -435,6 +502,10 @@ writeCCode(const char *filename, const char *destdir, const char *optName, const " uint8_t bytes[%ld]; \n" "} %s={ 0.0, {\n", (long)T_FileStream_size(in), entry); + if (count >= sizeof(buffer)) { + fprintf(stderr, "genccode: entry name too long (long filename?)\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } T_FileStream_writeLine(out, buffer); for(;;) { @@ -588,66 +659,84 @@ write8str(FileStream *out, uint8_t byte, uint32_t column) { #endif static void -getOutFilename(const char *inFilename, const char *destdir, char *outFilename, char *entryName, const char *newSuffix, const char *optFilename) { +getOutFilename( + const char *inFilename, + const char *destdir, + char *outFilename, + int32_t outFilenameCapacity, + char *entryName, + int32_t entryNameCapacity, + const char *newSuffix, + const char *optFilename) { const char *basename=findBasename(inFilename), *suffix=uprv_strrchr(basename, '.'); + icu::CharString outFilenameBuilder; + icu::CharString entryNameBuilder; + icu::ErrorCode status; + /* copy path */ if(destdir!=NULL && *destdir!=0) { - do { - *outFilename++=*destdir++; - } while(*destdir!=0); - if(*(outFilename-1)!=U_FILE_SEP_CHAR) { - *outFilename++=U_FILE_SEP_CHAR; - } - inFilename=basename; + outFilenameBuilder.append(destdir, status); + outFilenameBuilder.ensureEndsWithFileSeparator(status); } else { - while(inFilename= outFilenameCapacity) { + fprintf(stderr, "genccode: output filename too long\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } + + if (entryNameBuilder.length() >= entryNameCapacity) { + fprintf(stderr, "genccode: entry name too long (long filename?)\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } + + uprv_strcpy(outFilename, outFilenameBuilder.data()); + uprv_strcpy(entryName, entryNameBuilder.data()); } #ifdef CAN_GENERATE_OBJECTS @@ -685,23 +774,30 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char *pBits=32; *pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB); #elif U_PLATFORM_HAS_WIN32_API -/* _M_IA64 should be defined in windows.h */ -# if defined(_M_IA64) - *pCPU=IMAGE_FILE_MACHINE_IA64; - *pBits = 64; -# elif defined(_M_AMD64) -// link.exe does not really care about the .obj machine type and this will -// allow us to build a dll for both ARM & x64 with an amd64 built tool -// ARM is same as x64 except for first 2 bytes of object file - *pCPU = IMAGE_FILE_MACHINE_UNKNOWN; - // *pCPU = IMAGE_FILE_MACHINE_ARMNT; // If we wanted to be explicit - // *pCPU = IMAGE_FILE_MACHINE_AMD64; // We would use one of these names - *pBits = 64; // Doesn't seem to be used for anything interesting? + // Windows always runs in little-endian mode. + *pIsBigEndian = FALSE; + + // Note: The various _M_ macros are predefined by the MSVC compiler based + // on the target compilation architecture. + // https://docs.microsoft.com/cpp/preprocessor/predefined-macros + + // link.exe will link an IMAGE_FILE_MACHINE_UNKNOWN data-only .obj file + // no matter what architecture it is targeting (though other values are + // required to match). Unfortunately, the variable name decoration/mangling + // is slightly different on x86, which means we can't use the UNKNOWN type + // for all architectures though. +# if defined(_M_IX86) + *pCPU = IMAGE_FILE_MACHINE_I386; # else - *pCPU=IMAGE_FILE_MACHINE_I386; // We would use one of these names + *pCPU = IMAGE_FILE_MACHINE_UNKNOWN; +# endif +# if defined(_M_IA64) || defined(_M_AMD64) || defined (_M_ARM64) + *pBits = 64; // Doesn't seem to be used for anything interesting though? +# elif defined(_M_IX86) || defined(_M_ARM) *pBits = 32; +# else +# error "Unknown platform for CAN_GENERATE_OBJECTS." # endif - *pIsBigEndian=FALSE; #else # error "Unknown platform for CAN_GENERATE_OBJECTS." #endif @@ -775,7 +871,14 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char } U_CAPI void U_EXPORT2 -writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath) { +writeObjectCode( + const char *filename, + const char *destdir, + const char *optEntryPoint, + const char *optMatchArch, + const char *optFilename, + char *outFilePath, + size_t outFilePathCapacity) { /* common variables */ char buffer[4096], entry[96]={ 0 }; FileStream *in, *out; @@ -1059,8 +1162,21 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP } size=T_FileStream_size(in); - getOutFilename(filename, destdir, buffer, entry+entryOffset, newSuffix, optFilename); + getOutFilename( + filename, + destdir, + buffer, + sizeof(buffer), + entry + entryOffset, + sizeof(entry) - entryOffset, + newSuffix, + optFilename); + if (outFilePath != NULL) { + if (uprv_strlen(buffer) >= outFilePathCapacity) { + fprintf(stderr, "genccode: filename too long\n"); + exit(U_ILLEGAL_ARGUMENT_ERROR); + } uprv_strcpy(outFilePath, buffer); } diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.h b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.h index 5039f27db5e..47e8304a689 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.h +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_genc.h @@ -75,12 +75,31 @@ U_INTERNAL UBool U_EXPORT2 checkAssemblyHeaderName(const char* optAssembly); U_INTERNAL void U_EXPORT2 -writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath); +writeCCode( + const char *filename, + const char *destdir, + const char *optName, + const char *optFilename, + char *outFilePath, + size_t outFilePathCapacity); U_INTERNAL void U_EXPORT2 -writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath); +writeAssemblyCode( + const char *filename, + const char *destdir, + const char *optEntryPoint, + const char *optFilename, + char *outFilePath, + size_t outFilePathCapacity); U_INTERNAL void U_EXPORT2 -writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath); +writeObjectCode( + const char *filename, + const char *destdir, + const char *optEntryPoint, + const char *optMatchArch, + const char *optFilename, + char *outFilePath, + size_t outFilePathCapacity); #endif diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_gencmn.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_gencmn.cpp index 423e4b7363c..29a1f7bc180 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_gencmn.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkg_gencmn.cpp @@ -379,14 +379,14 @@ createCommonDataFile(const char *destDir, const char *name, const char *entrypoi " {0, 0, 0, 0}\n" " },\n" " \"\", %lu, 0, {\n", - (unsigned long)32-4-sizeof(UDataInfo), - (unsigned long)fileCount, + static_cast(32-4-sizeof(UDataInfo)), + static_cast(fileCount), entrypointName, - (unsigned long)sizeof(UDataInfo), + static_cast(sizeof(UDataInfo)), U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, U_SIZEOF_UCHAR, - (unsigned long)fileCount + static_cast(fileCount) ); T_FileStream_writeLine(out, buffer); diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkgitems.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkgitems.cpp index cb23b45e633..7b86c55fa42 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/pkgitems.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/pkgitems.cpp @@ -305,7 +305,8 @@ ures_enumDependencies(const char *itemName, break; } int32_t length; - const UChar *alias=res_getString(pResData, res, &length); + // No tracing: build tool + const UChar *alias=res_getStringNoTrace(pResData, res, &length); checkAlias(itemName, res, alias, length, useResSuffix, check, context, pErrorCode); } break; diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/swapimpl.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/swapimpl.cpp index e8850cb9864..926755a2aa8 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/swapimpl.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/swapimpl.cpp @@ -41,6 +41,7 @@ #include "uarrsort.h" #include "ucmndata.h" #include "udataswp.h" +#include "ulayout_props.h" /* swapping implementations in common */ @@ -640,6 +641,106 @@ unorm_swap(const UDataSwapper *ds, #endif +// Unicode text layout properties data swapping -------------------------------- + +static int32_t U_CALLCONV +ulayout_swap(const UDataSwapper *ds, + const void *inData, int32_t length, void *outData, + UErrorCode *pErrorCode) { + // udata_swapDataHeader checks the arguments. + int32_t headerSize = udata_swapDataHeader(ds, inData, length, outData, pErrorCode); + if (pErrorCode == nullptr || U_FAILURE(*pErrorCode)) { + return 0; + } + + // Check data format and format version. + const UDataInfo *pInfo = (const UDataInfo *)((const char *)inData + 4); + if (!( + pInfo->dataFormat[0] == ULAYOUT_FMT_0 && // dataFormat="Layo" + pInfo->dataFormat[1] == ULAYOUT_FMT_1 && + pInfo->dataFormat[2] == ULAYOUT_FMT_2 && + pInfo->dataFormat[3] == ULAYOUT_FMT_3 && + pInfo->formatVersion[0] == 1)) { + udata_printError(ds, + "ulayout_swap(): data format %02x.%02x.%02x.%02x (format version %02x) " + "is not recognized as text layout properties data\n", + pInfo->dataFormat[0], pInfo->dataFormat[1], + pInfo->dataFormat[2], pInfo->dataFormat[3], + pInfo->formatVersion[0]); + *pErrorCode = U_UNSUPPORTED_ERROR; + return 0; + } + + const uint8_t *inBytes = (const uint8_t *)inData + headerSize; + uint8_t *outBytes = (uint8_t *)outData + headerSize; + + const int32_t *inIndexes = (const int32_t *)inBytes; + + if (length >= 0) { + length -= headerSize; + if (length < 12 * 4) { + udata_printError(ds, + "ulayout_swap(): too few bytes (%d after header) for text layout properties data\n", + length); + *pErrorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + } + + int32_t indexesLength = udata_readInt32(ds, inIndexes[ULAYOUT_IX_INDEXES_LENGTH]); + if (indexesLength < 12) { + udata_printError(ds, + "ulayout_swap(): too few indexes (%d) for text layout properties data\n", + indexesLength); + *pErrorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + + // Read the data offsets before swapping anything. + int32_t indexes[ULAYOUT_IX_TRIES_TOP + 1]; + for (int32_t i = ULAYOUT_IX_INPC_TRIE_TOP; i <= ULAYOUT_IX_TRIES_TOP; ++i) { + indexes[i] = udata_readInt32(ds, inIndexes[i]); + } + int32_t size = indexes[ULAYOUT_IX_TRIES_TOP]; + + if (length >= 0) { + if (length < size) { + udata_printError(ds, + "ulayout_swap(): too few bytes (%d after header) " + "for all of text layout properties data\n", + length); + *pErrorCode = U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + + // Copy the data for inaccessible bytes. + if (inBytes != outBytes) { + uprv_memcpy(outBytes, inBytes, size); + } + + // Swap the int32_t indexes[]. + int32_t offset = 0; + int32_t count = indexesLength * 4; + ds->swapArray32(ds, inBytes, count, outBytes, pErrorCode); + offset += count; + + // Swap each trie. + for (int32_t i = ULAYOUT_IX_INPC_TRIE_TOP; i <= ULAYOUT_IX_TRIES_TOP; ++i) { + int32_t top = indexes[i]; + count = top - offset; + U_ASSERT(count >= 0); + if (count >= 16) { + utrie_swapAnyVersion(ds, inBytes + offset, count, outBytes + offset, pErrorCode); + } + offset = top; + } + + U_ASSERT(offset == size); + } + + return headerSize + size; +} + /* Swap 'Test' data from gentest */ static int32_t U_CALLCONV test_swap(const UDataSwapper *ds, @@ -731,6 +832,10 @@ static const struct { { { 0x4e, 0x6f, 0x72, 0x6d }, unorm_swap }, /* dataFormat="Norm" */ { { 0x4e, 0x72, 0x6d, 0x32 }, unorm2_swap }, /* dataFormat="Nrm2" */ #endif + + { { ULAYOUT_FMT_0, ULAYOUT_FMT_1, ULAYOUT_FMT_2, ULAYOUT_FMT_3 }, + ulayout_swap }, // dataFormat="Layo" + #if !UCONFIG_NO_COLLATION { { 0x55, 0x43, 0x6f, 0x6c }, ucol_swap }, /* dataFormat="UCol" */ { { 0x49, 0x6e, 0x76, 0x43 }, ucol_swapInverseUCA },/* dataFormat="InvC" */ diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.cpp index fb7263dcfe6..a035f2326a6 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.cpp @@ -143,7 +143,7 @@ findDirname(const char *path, char *buffer, int32_t bufLen, UErrorCode* status) resultLen = 0; } else { resultPtr = path; - resultLen = basename - path; + resultLen = static_cast(basename - path); if(resultLen<1) { resultLen = 1; /* '/' or '/a' -> '/' */ } @@ -243,7 +243,7 @@ struct UToolMemory { char name[64]; int32_t capacity, maxCapacity, size, idx; void *array; - UAlignedMemory staticArray[1]; + alignas(max_align_t) char staticArray[1]; }; U_CAPI UToolMemory * U_EXPORT2 diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.vcxproj b/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.vcxproj index bf379f20789..d6ab1042e4c 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/toolutil.vcxproj @@ -1,17 +1,16 @@  - - - {6B231032-3CB5-4EED-9210-810D666A23A0} - DynamicLibrary false MultiByte + + + @@ -34,18 +33,14 @@ <_ProjectFileVersion>10.0.30319.1 - .\..\..\..\lib\ - .\x86\Release\ - false - .\..\..\..\lib\ - .\x86\Debug\ - true - .\x64\Release\ - .\x64\Release\ - false - .\x64\Debug\ - .\x64\Debug\ - true + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false @@ -54,30 +49,49 @@ U_TOOLUTIL_IMPLEMENTATION;%(PreprocessorDefinitions) false Level3 + Default - - - .\..\..\..\lib\icutu.tlb - + + + + true + MultiThreadedDebugDLL + EditAndContinue + + + icuucd.lib;icuind.lib;%(AdditionalDependencies) + + + + - true MultiThreadedDLL true - .\x86\Release/toolutil.pch - .\x86\Release/ - .\x86\Release/ - .\x86\Release/ - Default - ..\..\..\bin\icutu63.dll icuuc.lib;icuin.lib;%(AdditionalDependencies) + + + + + + .\x86\$(Configuration)/toolutil.pch + .\x86\$(Configuration)/ + .\x86\$(Configuration)/ + .\x86\$(Configuration)/ + + ..\..\..\lib;%(AdditionalLibraryDirectories) + + + + + .\..\..\..\lib\icutu.tlb + + + ..\..\..\bin\icutu65.dll .\..\..\..\lib\icutu.pdb - UseLinkTimeCodeGeneration - 0x4ac00000 - false ..\..\..\lib\icutu.lib @@ -87,48 +101,36 @@ .\..\..\..\lib\icutud.tlb - - MultiThreadedDebugDLL - .\x86\Debug/toolutil.pch - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ - EditAndContinue - Default - - ..\..\..\bin\icutu63d.dll - icuucd.lib;icuind.lib;%(AdditionalDependencies) - ..\..\..\lib;%(AdditionalLibraryDirectories) + ..\..\..\bin\icutu65d.dll .\..\..\..\lib\icutud.pdb - 0x4ac00000 - false ..\..\..\lib\icutud.lib + + + + .\x64\$(Configuration)/toolutil.pch + .\x64\$(Configuration)/ + .\x64\$(Configuration)/ + .\x64\$(Configuration)/ + + + ..\..\..\lib64;%(AdditionalLibraryDirectories) + + .\..\..\..\lib64\icutu.tlb true - MultiThreadedDLL - true - .\x64\Release/toolutil.pch - .\x64\Release/ - .\x64\Release/ - .\x64\Release/ - Default - ..\..\..\bin64\icutu63.dll - icuuc.lib;icuin.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) + ..\..\..\bin64\icutu65.dll .\..\..\..\lib64\icutu.pdb - UseLinkTimeCodeGeneration - 0x4ac00000 ..\..\..\lib64\icutu.lib @@ -136,22 +138,78 @@ .\..\..\..\lib64\icutud.tlb + + ..\..\..\bin64\icutu65d.dll + .\..\..\..\lib64\icutud.pdb + ..\..\..\lib64\icutud.lib + + + + + .\ARM\$(Configuration)/toolutil.pch + .\ARM\$(Configuration)/ + .\ARM\$(Configuration)/ + .\ARM\$(Configuration)/ + + + .\..\..\..\libARM;%(AdditionalLibraryDirectories) + + + + + ..\..\..\libARM\icutu.tlb + + + ..\..\..\binARM\icutu65.dll + .\..\..\..\libARM\icutu.pdb + ..\..\..\libARM\icutu.lib + + + + + .\..\..\..\libARM\icutud.tlb + - MultiThreadedDebugDLL - .\x64\Debug/toolutil.pch - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ ProgramDatabase - Default - ..\..\..\bin64\icutu63d.dll - icuucd.lib;icuind.lib;%(AdditionalDependencies) - ..\..\..\lib64;%(AdditionalLibraryDirectories) - .\..\..\..\lib64\icutud.pdb - 0x4ac00000 - ..\..\..\lib64\icutud.lib + ..\..\..\binARM\icutu65d.dll + .\..\..\..\libARM\icutud.pdb + ..\..\..\libARM\icutud.lib + + + + + .\ARM64\$(Configuration)/toolutil.pch + .\ARM64\$(Configuration)/ + .\ARM64\$(Configuration)/ + .\ARM64\$(Configuration)/ + + + .\..\..\..\libARM64;%(AdditionalLibraryDirectories) + + + + + .\..\..\..\libARM64\icutu.tlb + + + ..\..\..\binARM64\icutu65.dll + .\..\..\..\libARM64\icutu.pdb + ..\..\..\libARM64\icutu.lib + + + + + .\..\..\..\libARM64\icutud.tlb + + + ProgramDatabase + + + ..\..\..\binARM64\icutu65d.dll + .\..\..\..\libARM64\icutud.pdb + ..\..\..\libARM64\icutud.lib diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.cpp index fa9edd15702..d1d4043dd4a 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.cpp @@ -178,7 +178,7 @@ ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){ memmove(buf->buffer,buf->currentPos,offset* sizeof(UChar)); } -#if UCBUF_DEBUG +#ifdef UCBUF_DEBUG memset(pTarget+offset,0xff,sizeof(UChar)*(MAX_IN_BUF-offset)); #endif if(buf->isBuffered){ @@ -295,7 +295,7 @@ ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){ } outputWritten = (int32_t)(target - pTarget); -#if UCBUF_DEBUG +#ifdef UCBUF_DEBUG { int i; target = pTarget; diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.h b/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.h index 81f8ba66333..116da37e9bc 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.h +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/ucbuf.h @@ -32,11 +32,11 @@ typedef struct UCHARBUF UCHARBUF; /** * End of file value */ -#define U_EOF 0xFFFFFFFF +#define U_EOF ((int32_t)0xFFFFFFFF) /** * Error value if a sequence cannot be unescaped */ -#define U_ERR 0xFFFFFFFE +#define U_ERR ((int32_t)0xFFFFFFFE) typedef struct ULine ULine; diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/ucmstate.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/ucmstate.cpp index fd461c20da9..ed1afb918eb 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/ucmstate.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/ucmstate.cpp @@ -653,7 +653,8 @@ compactToUnicode2(UCMStates *states, /* for each lead byte */ for(i=0; i<256; ++i) { entry=states->stateTable[leadState][i]; - if(MBCS_ENTRY_IS_TRANSITION(entry) && (MBCS_ENTRY_TRANSITION_STATE(entry))==trailState) { + if(MBCS_ENTRY_IS_TRANSITION(entry) && + (MBCS_ENTRY_TRANSITION_STATE(entry))==static_cast(trailState)) { /* the offset is different for each lead byte */ offset=MBCS_ENTRY_TRANSITION_OFFSET(entry); /* for each trail byte for this lead byte */ diff --git a/Build/source/libs/icu/icu-src/source/tools/toolutil/xmlparser.cpp b/Build/source/libs/icu/icu-src/source/tools/toolutil/xmlparser.cpp index 1ca111c0756..a9650cc5999 100644 --- a/Build/source/libs/icu/icu-src/source/tools/toolutil/xmlparser.cpp +++ b/Build/source/libs/icu/icu-src/source/tools/toolutil/xmlparser.cpp @@ -313,7 +313,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) { // reached end of file, convert once more to flush the converter flush=TRUE; } - }; + } exit: ucnv_close(cnv); diff --git a/Build/source/libs/icu/icu-src/source/tools/tzcode/Makefile.in b/Build/source/libs/icu/icu-src/source/tools/tzcode/Makefile.in index 63c9230086e..80139f79930 100644 --- a/Build/source/libs/icu/icu-src/source/tools/tzcode/Makefile.in +++ b/Build/source/libs/icu/icu-src/source/tools/tzcode/Makefile.in @@ -18,6 +18,28 @@ ifeq ($(TZCODE),) TZCODE = $(firstword $(wildcard ./tzcode*.tar.gz) $(wildcard $(srcdir)/tzcode*.tar.gz)) endif + +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward +NDATA= systemv +SDATA= solar87 solar88 solar89 +#TDATA= $(YDATA) $(NDATA) $(SDATA) +TDATA= $(YDATA) $(NDATA) +YEARISTYPE= ./yearistype + +TZDIR=zoneinfo + +CFLAGS+=-D_POSIX_C_SOURCE +CPPFLAGS+= -DTZDIR=\"$(TZDIR)\" + +# more data +XDATA=zone.tab yearistype.sh leapseconds iso3166.tab +ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo64.txt zoneinfo.txt + +VANGUARD_DIR= ./vanguard + +# For TZ DB/ICU comparison TZORIG=./tzorig TZORIG_TZDIR=./tzorig/tzdir TZORIG_ABS := $(shell pwd)/tzorig @@ -70,6 +92,10 @@ tzorig: $(TZCODE) $(TZDATA) mkdir $(TZORIG_TZDIR) gunzip -d < $(TZDATA) | ( cd $@ ; tar xf - ) gunzip -d < $(TZCODE) | ( cd $@ ; tar xf - ) + for tzfile in $(TDATA) ; do \ + mv $(TZORIG)/$$tzfile $(TZORIG)/$$tzfile.bak && \ + awk -v DATAFORM=rearguard -f $(TZORIG)/ziguard.awk $(TZORIG)/$$tzfile.bak > $(TZORIG)/$$tzfile; \ + done -mv $(TZORIG)/zdump.c $(TZORIG)/zdump.c.orig cp $(srcdir)/zdump.c $(TZORIG)/zdump.c -mv $(TZORIG)/factory $(TZORIG)/factory.orig @@ -103,24 +129,6 @@ $(ICUZDUMPOUT): $(ICUZDUMPEXEC) # -PRIMARY_YDATA= africa antarctica asia australasia \ - europe northamerica southamerica -YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward -NDATA= systemv -SDATA= solar87 solar88 solar89 -#TDATA= $(YDATA) $(NDATA) $(SDATA) -TDATA= $(YDATA) $(NDATA) -YEARISTYPE= ./yearistype - -TZDIR=zoneinfo - -CFLAGS+=-D_POSIX_C_SOURCE -CPPFLAGS+= -DTZDIR=\"$(TZDIR)\" - -# more data -XDATA=zone.tab yearistype.sh leapseconds iso3166.tab -ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo64.txt zoneinfo.txt - $(ZICTARG): $(OBJECTS) $(TDATA) yearistype $(srcdir)/tz2icu.h $(CC) $(CFLAGS) $(TZORIG_EXTRA_CFLAGS) $(LFLAGS) -I$(srcdir) $(OBJECTS) $(LDLIBS) -o $@ @@ -134,7 +142,12 @@ $(ICUZDUMPTARG): $(srcdir)/icuzdump.cpp $(TDATA): tdatamarker tdatamarker: $(TZDATA) + mkdir $(VANGUARD_DIR) gunzip -d < $(TZDATA) | tar xf - --exclude=Makefile + for tzfile in $(TDATA) ; do \ + mv $$tzfile $(VANGUARD_DIR)/$$tzfile && \ + awk -v DATAFORM=rearguard -f ziguard.awk $(VANGUARD_DIR)/$$tzfile > $$tzfile; \ + done touch $@ yearistype: yearistype.sh @@ -154,10 +167,11 @@ clean: @echo ICU specific cleanup: -rm -f $(ICUDATA) -rm -rf $(TZDIR) + -rm -rf $(VANGUARD_DIR) -$(RMV) $(ICUZDUMPTARG) tzorig ./zdumpout/ ./icuzdumpout/ ifneq ($(TZDATA),) -rm -rf `gunzip -d < $(TZDATA) | tar tf - --exclude=Makefile | grep -o '[^ ]*$$' | tr '\n' ' '` - -rm tdatamarker + -rm -f tdatamarker endif checkclean: diff --git a/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzdump.vcxproj b/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzdump.vcxproj index 15c9432a6cb..4f7b96fc291 100644 --- a/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzdump.vcxproj +++ b/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzdump.vcxproj @@ -77,7 +77,6 @@ true .\x86\Debug/icuzdump.pdb Console - false NotSet @@ -97,7 +96,6 @@ Console true true - false MachineX86 diff --git a/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzones b/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzones index c1ded7ba3ed..77cf71945b5 100644 --- a/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzones +++ b/Build/source/libs/icu/icu-src/source/tools/tzcode/icuzones @@ -77,101 +77,3 @@ Link Asia/Ho_Chi_Minh VST # ICU may also remove these aliases. # Link America/Regina Canada/East-Saskatchewan # removed from backward in 2017c - - -# Note: -# Following section was added for tz database 2018a and 2018b. -# ICU has a bug handling negative DST, and we also don't want to -# flip sumer time name and winter time name for Dublin at least for -# now. Because the change had major impacts to tz database external -# consumers, the tz database maintainer once reverted the Europe/Dublin -# rules (same as 2017c or older) in 2018c. The tz database maintainer -# thinks the changes in 2018a should be brought back when external -# tz database consumers are ready to adopt the change. We don't know -# what CLDR TC want to do with this for now. But if tz database brings -# back the change, and CLDR TC (and ICU TC) want to keep the display name -# unchanged, then we can uncomment the block below to restore ICU -# custom override. (Yoshito 2018-01-23) - -# -# tzdata2018a changed Europe/Dublin to use IST (UTC+1) as the standard time -# of the region, and GMT (UTC) as the daylight saving time with negative -# offset (-1 hour) in winter. ICU SimpleTimeZone rejects a zone with negative -# daylight saving time offset. We could remove the restriction in newer version -# of ICU, but such data does not work well with older ICU runtime without -# fixing the issue. For now, we define our own Europe/Dubin in ICU, replacing -# Europe/Dublin data from the tz database. -# - -# -# tzdata2018e suggests to use alternative zone definitions for use GB-Eire -# and EU rule after Oct 27, 1968. (Yoshito 2018-05-04) -# - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Dublin--ICU -0:25:00 - LMT 1880 Aug 2 - -0:25:21 - DMT 1916 May 21 2:00s - -0:25:21 1:00 IST 1916 Oct 1 2:00s - 0:00 GB-Eire %s 1921 Dec 6 # independence - 0:00 GB-Eire GMT/IST 1940 Feb 25 2:00s - 0:00 1:00 IST 1946 Oct 6 2:00s - 0:00 - GMT 1947 Mar 16 2:00s - 0:00 1:00 IST 1947 Nov 2 2:00s - 0:00 - GMT 1948 Apr 18 2:00s - 0:00 GB-Eire GMT/IST 1968 Oct 27 -# The next line is for when negative SAVE values are used. -# 1:00 Eire IST/GMT -# These three lines are for when SAVE values are always nonnegative. - 1:00 - IST 1971 Oct 31 2:00u - 0:00 GB-Eire GMT/IST 1996 - 0:00 EU GMT/IST - -Link Europe/Dublin--ICU Eire--ICU - - -# -# tzdata2018e also added another instance of negative DST to -# Europe/Prague and Africa/Windhoek -# -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Prague--ICU 0:57:44 - LMT 1850 - 0:57:44 - PMT 1891 Oct # Prague Mean Time - 1:00 C-Eur CE%sT 1945 May 9 - 1:00 Czech CE%sT 1946 Dec 1 3:00 -# Vanguard section, for zic and other parsers that support negative DST. -# 1:00 -1:00 GMT 1947 Feb 23 2:00 -# Rearguard section, for parsers that do not support negative DST. - 0:00 - GMT 1947 Feb 23 2:00 -# End of rearguard section. - 1:00 Czech CE%sT 1979 - 1:00 EU CE%sT - -# Slovakia -Link Europe/Prague--ICU Europe/Bratislava--ICU - -# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S -# Vanguard section, for zic and other parsers that support negative DST. -#Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT -#Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT -#Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT -# Rearguard section, for parsers that do not support negative DST. -Rule Namibia--ICU 1994 only - Mar 21 0:00 0 WAT -Rule Namibia--ICU 1994 2017 - Sep Sun>=1 2:00 1:00 CAT -Rule Namibia--ICU 1995 2017 - Apr Sun>=1 2:00 0 WAT - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Windhoek--ICU 1:08:24 - LMT 1892 Feb 8 - 1:30 - +0130 1903 Mar - 2:00 - SAST 1942 Sep 20 2:00 - 2:00 1:00 SAST 1943 Mar 21 2:00 - 2:00 - SAST 1990 Mar 21 # independence -# Vanguard section, for zic and other parsers that support negative DST. -# 2:00 Namibia %s -# Rearguard section, for parsers that do not support negative DST. - 2:00 - CAT 1994 Mar 21 0:00 -# From Paul Eggert (2017-04-07): -# The official date of the 2017 rule change was 2017-10-24. See: -# http://www.lac.org.na/laws/annoSTAT/Namibian%20Time%20Act%209%20of%202017.pdf - 1:00 Namibia--ICU %s 2017 Oct 24 - 2:00 - CAT -# End of rearguard section. -- cgit v1.2.3