From: Shane Carr Date: Mon, 2 Oct 2017 22:55:16 +0000 (+0000) Subject: ICU-13383 Applying code review feedback for MSVC DLL interface warning. X-Git-Tag: release-60-rc~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4efe6d3d783947d7649eee889b29a24f16c460a;p=icu ICU-13383 Applying code review feedback for MSVC DLL interface warning. X-SVN-Rev: 40524 --- diff --git a/icu4c/source/i18n/number_decimfmtprops.h b/icu4c/source/i18n/number_decimfmtprops.h index da4b34f7f73..7c2d4d669d9 100644 --- a/icu4c/source/i18n/number_decimfmtprops.h +++ b/icu4c/source/i18n/number_decimfmtprops.h @@ -17,10 +17,16 @@ U_NAMESPACE_BEGIN namespace number { namespace impl { +// Export an explicit template instantiation of the LocalPointer that is used as a +// data member of CurrencyPluralInfoWrapper. +// (MSVC requires this, even though it should not be necessary.) +#if defined (_MSC_VER) +template class U_I18N_API LocalPointer; +#endif + // TODO: Figure out a nicer way to deal with CurrencyPluralInfo. // Exported as U_I18N_API because it is a public member field of exported DecimalFormatProperties struct U_I18N_API CurrencyPluralInfoWrapper { - UPRV_SUPPRESS_DLL_INTERFACE_WARNING // LocalPointer is defined in a header file; why does Visual Studio complain? LocalPointer fPtr; CurrencyPluralInfoWrapper() {} diff --git a/icu4c/source/i18n/number_patternmodifier.h b/icu4c/source/i18n/number_patternmodifier.h index 0beeffe91f9..52e57c29259 100644 --- a/icu4c/source/i18n/number_patternmodifier.h +++ b/icu4c/source/i18n/number_patternmodifier.h @@ -29,10 +29,10 @@ class U_I18N_API ImmutablePatternModifier : public MicroPropsGenerator { void applyToMicros(MicroProps µs, DecimalQuantity &quantity) const; private: - ImmutablePatternModifier(ParameterizedModifier *pm, const PluralRules *rules, const MicroPropsGenerator *parent); + ImmutablePatternModifier(ParameterizedModifier *pm, const PluralRules *rules, const MicroPropsGenerator *parent); - UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported - const LocalPointer pm; + UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported + const LocalPointer pm; const PluralRules *rules; const MicroPropsGenerator *parent; diff --git a/icu4c/source/i18n/number_patternstring.h b/icu4c/source/i18n/number_patternstring.h index 81b81763570..d48b1bd6481 100644 --- a/icu4c/source/i18n/number_patternstring.h +++ b/icu4c/source/i18n/number_patternstring.h @@ -96,8 +96,8 @@ struct U_I18N_API ParsedPatternInfo : public AffixPatternProvider, public UMemor // This method is here as a shell for Java compatibility. inline void toParseException(const char16_t *message) { (void)message; } } - UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported - state; + UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported + state; // NOTE: In Java, these are written as pure functions. // In C++, they're written as methods. diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 60f25ac5c50..7afda66824a 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -1818,9 +1818,9 @@ class U_I18N_API LocalizedNumberFormatter ~LocalizedNumberFormatter(); private: - UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported + UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported std::atomic fCompiled{nullptr}; - UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported + UPRV_SUPPRESS_DLL_INTERFACE_WARNING // Member is private and does not need to be exported std::atomic fCallCount{0}; LocalizedNumberFormatter() = default;