]> granicus.if.org Git - icu/commitdiff
ICU-22203 Windows: enable C-code generation with overridden entry point
authorL. E. Segovia <amy@amyspark.me>
Wed, 16 Nov 2022 22:16:08 +0000 (19:16 -0300)
committerMarkus Scherer <markus.icu@gmail.com>
Fri, 2 Dec 2022 19:45:09 +0000 (11:45 -0800)
icu4c/source/tools/genccode/genccode.c
icu4c/source/tools/pkgdata/pkgdata.cpp
icu4c/source/tools/toolutil/pkg_genc.cpp
icu4c/source/tools/toolutil/pkg_genc.h

index 219335f183c10c7e363704017fdabc62704bf66f..9fb7dbcdf2eb95e13bc6a264e06ee3eec93169c9 100644 (file)
@@ -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,
index e1edcd3cac3c102c567e8379b722aa37017b4c5d..5bb9830299e2fac9b91294d1b0309b391bfc80a6 100644 (file)
@@ -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,
index 4dab597da5d377d5c5df156cb234664e00991e83..7bed02c1888ff9893187801108f28afc3c83bf05 100644 (file)
@@ -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<length; ++i) {
index 72d968703550205cd3baca551f42206083c7b552..2dd1b45cde992eb78a39d7b5ae6b98120a0b9302 100644 (file)
@@ -78,6 +78,7 @@ U_CAPI void U_EXPORT2
 writeCCode(
     const char *filename,
     const char *destdir,
+    const char *optEntryPoint,
     const char *optName,
     const char *optFilename,
     char *outFilePath,