blob: 089ab52dbfe02e2a9c64b1758ce370119af13a57 [file] [log] [blame]
diff --git a/source/common/umutex.h b/source/common/umutex.h
index 015a12f9..b5962e99 100644
--- a/source/common/umutex.h
+++ b/source/common/umutex.h
@@ -54,15 +54,19 @@ U_NAMESPACE_END
#include <atomic>
-U_NAMESPACE_BEGIN
-
-// Export an explicit template instantiation of std::atomic<int32_t>.
+// Export an explicit template instantiation of std::atomic<int32_t>.
// When building DLLs for Windows this is required as it is used as a data member of the exported SharedObject class.
// See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples.
-#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
-template struct U_COMMON_API std::atomic<int32_t>;
+#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN && !defined(U_IN_DOXYGEN)
+ #if defined(__clang__) && __has_warning("-Winstantiation-after-specialization")
+ // Suppress the warning that the explicit instantiation after explicit specialization has no effect.
+ #pragma clang diagnostic ignored "-Winstantiation-after-specialization"
+ #endif
+template <> struct U_COMMON_API std::atomic<int32_t>;
#endif
+U_NAMESPACE_BEGIN
+
typedef std::atomic<int32_t> u_atomic_int32_t;
#define ATOMIC_INT32_T_INITIALIZER(val) ATOMIC_VAR_INIT(val)
diff --git a/source/i18n/unicode/numberrangeformatter.h b/source/i18n/unicode/numberrangeformatter.h
index 50546839..3f2d5158 100644
--- a/source/i18n/unicode/numberrangeformatter.h
+++ b/source/i18n/unicode/numberrangeformatter.h
@@ -186,7 +186,13 @@ class NumberRangeFormatterImpl;
* (When building DLLs for Windows this is required.)
*/
#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN && !defined(U_IN_DOXYGEN)
-template struct U_I18N_API std::atomic<impl::NumberRangeFormatterImpl*>;
+} // namespace number
+U_NAMESPACE_END
+
+template struct U_I18N_API std::atomic<icu::number::impl::NumberRangeFormatterImpl*>;
+
+U_NAMESPACE_BEGIN
+namespace number { // icu::number
#endif
/** \endcond */