X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..729e4ab9bc6618bc3d8a898e575df7f4019e29ca:/icuSources/tools/genctd/genctd.cpp diff --git a/icuSources/tools/genctd/genctd.cpp b/icuSources/tools/genctd/genctd.cpp index 1b114ec2..e5dccbf7 100644 --- a/icuSources/tools/genctd/genctd.cpp +++ b/icuSources/tools/genctd/genctd.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2002-2006, International Business Machines +* Copyright (C) 2002-2009, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * @@ -74,7 +74,7 @@ void usageAndDie(int retCode) { } -#if UCONFIG_NO_BREAK_ITERATION +#if UCONFIG_NO_BREAK_ITERATION || UCONFIG_NO_FILE_IO /* dummy UDataInfo cf. udata.h */ static UDataInfo dummyDataInfo = { @@ -157,13 +157,6 @@ int main(int argc, char **argv) { u_setDataDirectory(options[4].value); } - /* Initialize ICU */ - u_init(&status); - if (U_FAILURE(status)) { - fprintf(stderr, "%s: can not initialize ICU. status = %s\n", - argv[0], u_errorName(status)); - exit(1); - } status = U_ZERO_ERROR; /* Combine the directory with the file name */ @@ -174,13 +167,13 @@ int main(int argc, char **argv) { copyright = U_COPYRIGHT_STRING; } -#if UCONFIG_NO_BREAK_ITERATION +#if UCONFIG_NO_BREAK_ITERATION || UCONFIG_NO_FILE_IO UNewDataMemory *pData; char msg[1024]; /* write message with just the name */ - sprintf(msg, "genctd writes dummy %s because of UCONFIG_NO_BREAK_ITERATION, see uconfig.h", outFileName); + sprintf(msg, "genctd writes dummy %s because of UCONFIG_NO_BREAK_ITERATION and/or UCONFIG_NO_FILE_IO, see uconfig.h", outFileName); fprintf(stderr, "%s\n", msg); /* write the dummy data file */ @@ -190,6 +183,14 @@ int main(int argc, char **argv) { return (int)status; #else + /* Initialize ICU */ + u_init(&status); + if (U_FAILURE(status)) { + fprintf(stderr, "%s: can not initialize ICU. status = %s\n", + argv[0], u_errorName(status)); + exit(1); + } + status = U_ZERO_ERROR; // // Read in the dictionary source file