ICU-13383 Applying code review feedback for MSVC DLL interface warning.

X-SVN-Rev: 40524
This commit is contained in:
Shane Carr 2017-10-02 22:55:16 +00:00
parent 9831b84c80
commit a4efe6d3d7
4 changed files with 14 additions and 8 deletions

View 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() {}

View 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;

View 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.

View 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;