ICU-3445 don't compile prscmnts functions when RegEx is tuned off

X-SVN-Rev: 14057
This commit is contained in:
Ram Viswanadha 2003-12-09 20:07:47 +00:00
parent 5ade71a406
commit e42051e2b8
3 changed files with 26 additions and 1 deletions

View file

@ -21,6 +21,8 @@
#include <stdio.h>
#include <stdlib.h>
#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 */

View file

@ -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

View file

@ -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;