# 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
+
/** @} */
/*===========================================================================*/
// 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 {
-#pragma warning(suppress: 4251) // LocalPointer is defined in a header file; why does Visual Studio complain?
+ UPRV_SUPPRESS_DLL_INTERFACE_WARNING // LocalPointer is defined in a header file; why does Visual Studio complain?
LocalPointer<CurrencyPluralInfo> fPtr;
CurrencyPluralInfoWrapper() {}
private:
ImmutablePatternModifier(ParameterizedModifier *pm, const PluralRules *rules, const MicroPropsGenerator *parent);
-#pragma warning(suppress: 4251) // 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
const LocalPointer<ParameterizedModifier> pm;
const PluralRules *rules;
const MicroPropsGenerator *parent;
// This method is here as a shell for Java compatibility.
inline void toParseException(const char16_t *message) { (void)message; }
}
-#pragma warning(suppress: 4251) // 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
state;
// NOTE: In Java, these are written as pure functions.
~LocalizedNumberFormatter();
private:
-#pragma warning(suppress: 4251) // 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};
-#pragma warning(suppress: 4251) // 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;