From: L. E. Segovia Date: Wed, 16 Nov 2022 22:16:08 +0000 (-0300) Subject: ICU-22203 Windows: enable C-code generation with overridden entry point X-Git-Tag: cldr/2022-12-04~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba8e4087ca1b086d0e83a685654ff69a0005f1a9;p=icu ICU-22203 Windows: enable C-code generation with overridden entry point --- diff --git a/icu4c/source/tools/genccode/genccode.c b/icu4c/source/tools/genccode/genccode.c index 219335f183c..9fb7dbcdf2e 100644 --- a/icu4c/source/tools/genccode/genccode.c +++ b/icu4c/source/tools/genccode/genccode.c @@ -178,6 +178,7 @@ main(int argc, char* argv[]) { switch (writeCode) { case CALL_WRITECCODE: writeCCode(filename, options[kOptDestDir].value, + options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL, options[kOptName].doesOccur ? options[kOptName].value : NULL, options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL, NULL, diff --git a/icu4c/source/tools/pkgdata/pkgdata.cpp b/icu4c/source/tools/pkgdata/pkgdata.cpp index e1edcd3cac3..5bb9830299e 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.cpp +++ b/icu4c/source/tools/pkgdata/pkgdata.cpp @@ -1725,6 +1725,7 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD writeCCode( file, o->tmpDir, + NULL, dataName[0] != 0 ? dataName : o->shortName, newName[0] != 0 ? newName : NULL, gencmnFile, diff --git a/icu4c/source/tools/toolutil/pkg_genc.cpp b/icu4c/source/tools/toolutil/pkg_genc.cpp index 4dab597da5d..7bed02c1888 100644 --- a/icu4c/source/tools/toolutil/pkg_genc.cpp +++ b/icu4c/source/tools/toolutil/pkg_genc.cpp @@ -389,6 +389,7 @@ U_CAPI void U_EXPORT2 writeCCode( const char *filename, const char *destdir, + const char *optEntryPoint, const char *optName, const char *optFilename, char *outFilePath, @@ -444,6 +445,11 @@ writeCCode( exit(U_FILE_ACCESS_ERROR); } + if(optEntryPoint != NULL) { + uprv_strcpy(entry, optEntryPoint); + uprv_strcat(entry, "_dat"); + } + /* turn dashes or dots in the entry name into underscores */ length=uprv_strlen(entry); for(i=0; i