From 822f228b1a45baf59d5aabddadf91b9a208f747d Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 29 Aug 2014 03:41:29 +0000 Subject: [PATCH] ICU-10751 try to fix Windows build, apparently still not on C99 X-SVN-Rev: 36282 --- icu4c/source/common/uscript.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/icu4c/source/common/uscript.c b/icu4c/source/common/uscript.c index 2b1d190606e..799f28e2bda 100644 --- a/icu4c/source/common/uscript.c +++ b/icu4c/source/common/uscript.c @@ -95,6 +95,11 @@ uscript_getCode(const char* nameOrAbbrOrLocale, UScriptCode* fillIn, int32_t capacity, UErrorCode* err){ + UBool triedCode; + char likely[ULOC_FULLNAME_CAPACITY]; + UErrorCode internalErrorCode; + int32_t length; + if(U_FAILURE(*err)) { return 0; } @@ -104,7 +109,7 @@ uscript_getCode(const char* nameOrAbbrOrLocale, return 0; } - UBool triedCode = FALSE; + triedCode = FALSE; if(uprv_strchr(nameOrAbbrOrLocale, '-')==NULL && uprv_strchr(nameOrAbbrOrLocale, '_')==NULL ){ /* try long and abbreviated script names first */ UScriptCode code = (UScriptCode) u_getPropertyValueEnum(UCHAR_SCRIPT, nameOrAbbrOrLocale); @@ -113,9 +118,8 @@ uscript_getCode(const char* nameOrAbbrOrLocale, } triedCode = TRUE; } - char likely[ULOC_FULLNAME_CAPACITY]; - UErrorCode internalErrorCode = U_ZERO_ERROR; - int32_t length = getCodesFromLocale(nameOrAbbrOrLocale, fillIn, capacity, err); + internalErrorCode = U_ZERO_ERROR; + length = getCodesFromLocale(nameOrAbbrOrLocale, fillIn, capacity, err); if(U_FAILURE(*err) || length != 0) { return length; } -- 2.40.0