Skip to content

Commit

Permalink
ICU-22203 Windows: enable C-code generation with overridden entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
amyspark authored and markusicu committed Dec 2, 2022
1 parent e7aad77 commit ba8e408
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions icu4c/source/tools/genccode/genccode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions icu4c/source/tools/pkgdata/pkgdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions icu4c/source/tools/toolutil/pkg_genc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions icu4c/source/tools/toolutil/pkg_genc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ba8e408

Please sign in to comment.