From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Wed, 4 Oct 2017 03:13:36 +0000 (+0000) Subject: ICU-13383 Export explicit templates for MSVC, remove UPRV_SUPPRESS_DLL_INTERFACE_WARN... X-Git-Tag: release-60-rc~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab965990e58d988b23edd00d892e6a190e24692b;p=icu ICU-13383 Export explicit templates for MSVC, remove UPRV_SUPPRESS_DLL_INTERFACE_WARNING macro. X-SVN-Rev: 40542 --- diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 383c408adca..e1a7bdbc745 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -525,20 +525,6 @@ namespace std { # define U_FALLTHROUGH #endif -/** -* \def UPRV_SUPPRESS_DLL_INTERFACE_WARNING -* Add a pragma for suppressing warning 4251: -* "class X needs to have dll-interface to be used by clients of class Y" -* This warning is noisy when private member fields are at play. -* Macro is empty except on Visual C++. -* @internal -*/ -#if defined(_MSC_VER) -# define UPRV_SUPPRESS_DLL_INTERFACE_WARNING __pragma(warning(suppress: 4251)) -#else -# define UPRV_SUPPRESS_DLL_INTERFACE_WARNING -#endif - /** @} */ /*===========================================================================*/ diff --git a/icu4c/source/i18n/number_decimfmtprops.h b/icu4c/source/i18n/number_decimfmtprops.h index 7c2d4d669d9..27900f1802b 100644 --- a/icu4c/source/i18n/number_decimfmtprops.h +++ b/icu4c/source/i18n/number_decimfmtprops.h @@ -21,6 +21,9 @@ namespace impl { // data member of CurrencyPluralInfoWrapper. // (MSVC requires this, even though it should not be necessary.) #if defined (_MSC_VER) +// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!= +#pragma warning(suppress: 4661) +template class U_I18N_API LocalPointerBase; template class U_I18N_API LocalPointer; #endif diff --git a/icu4c/source/i18n/number_patternmodifier.h b/icu4c/source/i18n/number_patternmodifier.h index 8d38e2ef4cb..a04be4e9f9a 100644 --- a/icu4c/source/i18n/number_patternmodifier.h +++ b/icu4c/source/i18n/number_patternmodifier.h @@ -18,7 +18,17 @@ namespace impl { // Forward declaration class MutablePatternModifier; - + +// Export an explicit template instantiation of the LocalPointer that is used as a +// data member of ParameterizedModifier. +// (MSVC requires this, even though it should not be necessary.) +#if defined (_MSC_VER) +// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!= +#pragma warning(suppress: 4661) +template class U_I18N_API LocalPointerBase; +template class U_I18N_API LocalPointer; +#endif + // Exported as U_I18N_API because it is needed for the unit test PatternModifierTest class U_I18N_API ImmutablePatternModifier : public MicroPropsGenerator { public: @@ -31,7 +41,6 @@ class U_I18N_API ImmutablePatternModifier : public MicroPropsGenerator { private: 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; const PluralRules *rules; const MicroPropsGenerator *parent; diff --git a/icu4c/source/i18n/number_patternstring.h b/icu4c/source/i18n/number_patternstring.h index 50570c5d892..19b41251977 100644 --- a/icu4c/source/i18n/number_patternstring.h +++ b/icu4c/source/i18n/number_patternstring.h @@ -82,7 +82,7 @@ struct U_I18N_API ParsedPatternInfo : public AffixPatternProvider, public UMemor bool containsSymbolType(AffixPatternType type, UErrorCode &status) const U_OVERRIDE; private: - struct ParserState { + struct U_I18N_API ParserState { const UnicodeString &pattern; // reference to the parent int32_t offset = 0; @@ -96,7 +96,6 @@ 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; // NOTE: In Java, these are written as pure functions.