]> granicus.if.org Git - icu/commitdiff
ICU-22222 Add explicit instantiation declarations
authorThomas Köppe <tkoeppe@google.com>
Fri, 2 Dec 2022 01:49:06 +0000 (01:49 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Sat, 7 Jan 2023 00:03:38 +0000 (00:03 +0000)
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

icu4c/source/i18n/unicode/numberformatter.h
icu4c/source/i18n/unicode/numberrangeformatter.h

index 486af2869fd0496569b39e119c4437e9b8ede369..c4b375d9586e379a075cbfbc6fdc25da7bc470bf 100644 (file)
@@ -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<UnlocalizedNumberFormatter>;
+extern template class NumberFormatterSettings<LocalizedNumberFormatter>;
+#endif
+
 /**
  * A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be specified.
  *
index 7f535952d2f0ec2292678ff3723b1773bb957ee0..ef119a64f77aea120bb34b1100231a950fedbb3b 100644 (file)
@@ -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<UnlocalizedNumberRangeFormatter>;
+extern template class NumberRangeFormatterSettings<LocalizedNumberRangeFormatter>;
+#endif
+
 /**
  * A NumberRangeFormatter that does not yet have a locale. In order to format, a locale must be specified.
  *