From: Peter Edberg Date: Thu, 30 Jun 2011 05:41:03 +0000 (+0000) Subject: ICU-8622 Rearrange code & conditionals so UCONFIG_NO_SERVICE=1 works X-Git-Tag: milestone-59-0-1~4702 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e033e05d4d0e38410dfd127f1d1225145709ccb4;p=icu ICU-8622 Rearrange code & conditionals so UCONFIG_NO_SERVICE=1 works X-SVN-Rev: 30256 --- diff --git a/icu4c/source/i18n/ucurr.cpp b/icu4c/source/i18n/ucurr.cpp index c602f6a866b..ab3f6e460b4 100644 --- a/icu4c/source/i18n/ucurr.cpp +++ b/icu4c/source/i18n/ucurr.cpp @@ -242,10 +242,11 @@ idForLocale(const char* locale, char* countryAndVariant, int capacity, UErrorCod // don't use ICUService since we don't need fallback -#if !UCONFIG_NO_SERVICE U_CDECL_BEGIN static UBool U_CALLCONV currency_cleanup(void); U_CDECL_END + +#if !UCONFIG_NO_SERVICE struct CReg; static UMTX gCRegLock = 0; @@ -337,30 +338,6 @@ struct CReg : public U_NAMESPACE_QUALIFIER UMemory { } }; -/** - * Release all static memory held by currency. - */ -/*The declaration here is needed so currency_cleanup(void) - * can call this function. - */ -static UBool U_CALLCONV -currency_cache_cleanup(void); - -U_CDECL_BEGIN -static UBool U_CALLCONV currency_cleanup(void) { -#if !UCONFIG_NO_SERVICE - CReg::cleanup(); -#endif - /* - * There might be some cached currency data or isoCodes data. - */ - currency_cache_cleanup(); - isoCodes_cleanup(); - - return TRUE; -} -U_CDECL_END - // ------------------------------------- U_CAPI UCurrRegistryKey U_EXPORT2 @@ -388,6 +365,32 @@ ucurr_unregister(UCurrRegistryKey key, UErrorCode* status) // ------------------------------------- +/** + * Release all static memory held by currency. + */ +/*The declaration here is needed so currency_cleanup(void) + * can call this function. + */ +static UBool U_CALLCONV +currency_cache_cleanup(void); + +U_CDECL_BEGIN +static UBool U_CALLCONV currency_cleanup(void) { +#if !UCONFIG_NO_SERVICE + CReg::cleanup(); +#endif + /* + * There might be some cached currency data or isoCodes data. + */ + currency_cache_cleanup(); + isoCodes_cleanup(); + + return TRUE; +} +U_CDECL_END + +// ------------------------------------- + U_CAPI int32_t U_EXPORT2 ucurr_forLocale(const char* locale, UChar* buff,