From: Thomas Köppe Date: Fri, 2 Dec 2022 01:49:06 +0000 (+0000) Subject: ICU-22222 Add explicit instantiation declarations X-Git-Tag: cldr/2023-02-02~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c6d7fc98d0bf6967d2eb952cc686771c2cac78b;p=icu ICU-22222 Add explicit instantiation declarations We exclude these declarations from MSVC, where they don't work because the don't interact well with the U_I18N_API import/export macros --- diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 486af2869fd..c4b375d9586 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -2418,6 +2418,13 @@ class U_I18N_API NumberFormatterSettings { friend class impl::NumberRangeFormatterImpl; }; +// Explicit instantiations in source/i18n/number_fluent.cpp. +// (MSVC treats imports/exports of explicit instantiations differently.) +#ifndef _MSC_VER +extern template class NumberFormatterSettings; +extern template class NumberFormatterSettings; +#endif + /** * A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be specified. * diff --git a/icu4c/source/i18n/unicode/numberrangeformatter.h b/icu4c/source/i18n/unicode/numberrangeformatter.h index 7f535952d2f..ef119a64f77 100644 --- a/icu4c/source/i18n/unicode/numberrangeformatter.h +++ b/icu4c/source/i18n/unicode/numberrangeformatter.h @@ -381,6 +381,13 @@ class U_I18N_API NumberRangeFormatterSettings { friend class UnlocalizedNumberRangeFormatter; }; +// Explicit instantiations in source/i18n/numrange_fluent.cpp. +// (MSVC treats imports/exports of explicit instantiations differently.) +#ifndef _MSC_VER +extern template class NumberRangeFormatterSettings; +extern template class NumberRangeFormatterSettings; +#endif + /** * A NumberRangeFormatter that does not yet have a locale. In order to format, a locale must be specified. *