]> granicus.if.org Git - icu/commitdiff
ICU-13383 Export explicit templates for MSVC, remove UPRV_SUPPRESS_DLL_INTERFACE_WARN...
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Wed, 4 Oct 2017 03:13:36 +0000 (03:13 +0000)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Wed, 4 Oct 2017 03:13:36 +0000 (03:13 +0000)
X-SVN-Rev: 40542

icu4c/source/common/unicode/platform.h
icu4c/source/i18n/number_decimfmtprops.h
icu4c/source/i18n/number_patternmodifier.h
icu4c/source/i18n/number_patternstring.h

index 383c408adca3935af7a1ebc17851f38b3e54ae52..e1a7bdbc745e7ef50b45c63e17806837a1da3c16 100644 (file)
@@ -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
-
 /** @} */
 
 /*===========================================================================*/
index 7c2d4d669d9b409308387e6252e2ef0b921d32e3..27900f1802bdba4b0e05a835369f309e910b5732 100644 (file)
@@ -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<CurrencyPluralInfo>;
 template class U_I18N_API LocalPointer<CurrencyPluralInfo>;
 #endif
 
index 8d38e2ef4cb434eec05dcdedeffc6bc4ee91d2bc..a04be4e9f9ae03078e8c3aa0702c5e48dfe73dde 100644 (file)
@@ -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<ParameterizedModifier>;
+template class U_I18N_API LocalPointer<ParameterizedModifier>;
+#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<ParameterizedModifier> pm;
     const PluralRules *rules;
     const MicroPropsGenerator *parent;
index 50570c5d892069c795b88a65de3d8320ed16f088..19b41251977bf7bb2d822840ecffa3d71cabc377 100644 (file)
@@ -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.