]> granicus.if.org Git - icu/commitdiff
ICU-8622 Rearrange code & conditionals so UCONFIG_NO_SERVICE=1 works
authorPeter Edberg <pedberg@unicode.org>
Thu, 30 Jun 2011 05:41:03 +0000 (05:41 +0000)
committerPeter Edberg <pedberg@unicode.org>
Thu, 30 Jun 2011 05:41:03 +0000 (05:41 +0000)
X-SVN-Rev: 30256

icu4c/source/i18n/ucurr.cpp

index c602f6a866b506cc48fa35c7d53a3deca7943123..ab3f6e460b407d8c4d48011d609a3d2aabbe1e28 100644 (file)
@@ -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,