diff --git a/icu4c/source/tools/genrb/prscmnts.cpp b/icu4c/source/tools/genrb/prscmnts.cpp index 1f34417f99f..75a8b0ee078 100644 --- a/icu4c/source/tools/genrb/prscmnts.cpp +++ b/icu4c/source/tools/genrb/prscmnts.cpp @@ -21,6 +21,8 @@ #include #include +#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when RegularExpressions not available */ + #define MAX_SPLIT_STRINGS 20 const char *patternStrings[UPC_LIMIT]={ @@ -227,3 +229,5 @@ getNote(const UChar* source, int32_t srcLen, } +#endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */ + diff --git a/icu4c/source/tools/genrb/prscmnts.h b/icu4c/source/tools/genrb/prscmnts.h index 1a5a263b4ab..5651b8089c7 100644 --- a/icu4c/source/tools/genrb/prscmnts.h +++ b/icu4c/source/tools/genrb/prscmnts.h @@ -19,6 +19,8 @@ #ifndef PRSCMNTS_H #define PRSCMNTS_H 1 +#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */ + enum UParseCommentsOption { UPC_TRANSLATE, UPC_NOTE, @@ -53,5 +55,8 @@ getAt(const UChar* source, int32_t srcLen, U_CFUNC int32_t getCount(const UChar* source, int32_t srcLen, UParseCommentsOption option, UErrorCode *status); + +#endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */ + #endif diff --git a/icu4c/source/tools/genrb/wrtxml.c b/icu4c/source/tools/genrb/wrtxml.c index 912275f3293..1771167d0c6 100644 --- a/icu4c/source/tools/genrb/wrtxml.c +++ b/icu4c/source/tools/genrb/wrtxml.c @@ -493,6 +493,8 @@ print(UChar* src, int32_t srcLen,const char *tagStart,const char *tagEnd, UErro static void printNoteElements(struct UString *src, UErrorCode *status){ +#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */ + int32_t capacity = 0; UChar* note = NULL; int32_t noteLen = 0; @@ -520,10 +522,19 @@ printNoteElements(struct UString *src, UErrorCode *status){ } } uprv_free(note); +#else + + fprintf(stderr, "Warning: Could not output comments to XLIFF file. ICU has been built without RegularExpression support.\n"); + +#endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */ + } static void printComments(struct UString *src, const char *resName, UBool printTranslate, UErrorCode *status){ + +#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */ + int32_t capacity = src->fLength; char* buf = NULL; int32_t bufLen = 0; @@ -570,6 +581,11 @@ printComments(struct UString *src, const char *resName, UBool printTranslate, UE write_tabs(out); print(desc, descLen, "", status); } +#else + + fprintf(stderr, "Warning: Could not output comments to XLIFF file. ICU has been built without RegularExpression support.\n"); + +#endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */ } /* Writing Functions */ @@ -1294,7 +1310,7 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu uprv_strncpy(originalFileName, filename + first, index); if(uprv_strcmp(originalFileName, srBundle->fLocale) != 0) { - fprintf(stdout, "warning! The file name is not same as the resource name!\n"); + fprintf(stdout, "Warning: The file name is not same as the resource name!\n"); } temp = originalFileName;