]> granicus.if.org Git - icu/commitdiff
ICU-13383 Applying code review feedback for MSVC DLL interface warning.
authorShane Carr <shane@unicode.org>
Mon, 2 Oct 2017 22:55:16 +0000 (22:55 +0000)
committerShane Carr <shane@unicode.org>
Mon, 2 Oct 2017 22:55:16 +0000 (22:55 +0000)
X-SVN-Rev: 40524

icu4c/source/i18n/number_decimfmtprops.h
icu4c/source/i18n/number_patternmodifier.h
icu4c/source/i18n/number_patternstring.h
icu4c/source/i18n/unicode/numberformatter.h

index da4b34f7f7304285720200b1d8e08c8775dedc7d..7c2d4d669d9b409308387e6252e2ef0b921d32e3 100644 (file)
@@ -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<CurrencyPluralInfo>;
+#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<CurrencyPluralInfo> fPtr;
 
     CurrencyPluralInfoWrapper() {}
index 0beeffe91f95aae38de5689abf3f7535e086eaf3..52e57c292597bceeaec0986083415d8acb038c3d 100644 (file)
@@ -29,10 +29,10 @@ class U_I18N_API ImmutablePatternModifier : public MicroPropsGenerator {
     void applyToMicros(MicroProps &micros, 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<ParameterizedModifier> pm;
+    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 81b81763570120d3127586d0e569eb8641781a82..d48b1bd648115927d52ef045c7f102535f33848f 100644 (file)
@@ -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.
index 60f25ac5c505c275c970a0ea73bde10666615112..7afda66824a2d801d18260889d309fb34c0ee3f9 100644 (file)
@@ -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<const impl::NumberFormatterImpl *> 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<uint32_t> fCallCount{0};
 
     LocalizedNumberFormatter() = default;