]> granicus.if.org Git - icu/commitdiff
ICU-13788 Fix compiler error C4251 on Windows (MSVC, Clang, MinGW).
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Sun, 27 May 2018 03:07:57 +0000 (03:07 +0000)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Sun, 27 May 2018 03:07:57 +0000 (03:07 +0000)
X-SVN-Rev: 41470

icu4c/source/i18n/numparse_affixes.h

index 1a90b31b3e23fcd1d4d0eaa63439878951643bae..be8c4fb56473d190872b2300c20e0363fb0b06d3 100644 (file)
@@ -44,6 +44,21 @@ class CodePointMatcher : public NumberParseMatcher, public UMemory {
     UChar32 fCp;
 };
 
+} // namespace impl
+} // namespace numparse
+
+// Export a explicit template instantiations of MaybeStackArray and CompactUnicodeString.
+// When building DLLs for Windows this is required even though no direct access leaks out of the i18n library.
+// (See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples.)
+// Note: These need to be outside of the impl::numparse namespace, or Clang will generate a compile error.
+#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
+template class U_I18N_API MaybeStackArray<UChar, 4>;
+template class U_I18N_API MaybeStackArray<numparse::impl::CodePointMatcher*, 3>;
+template class U_I18N_API numparse::impl::CompactUnicodeString<4>;
+#endif
+
+namespace numparse {
+namespace impl {
 
 /**
  * A warehouse to retain ownership of CodePointMatchers.
@@ -234,16 +249,6 @@ class AffixMatcherWarehouse {
 
 } // namespace impl
 } // namespace numparse
-
-// Export a explicit template instantiations of MaybeStackArray and CompactUnicodeString.
-// When building DLLs for Windows this is required even though no direct access leaks out of the i18n library.
-// (See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples.)
-#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
-template class U_I18N_API MaybeStackArray<UChar, 4>;
-template class U_I18N_API MaybeStackArray<numparse::impl::CodePointMatcher*, 3>;
-template class U_I18N_API numparse::impl::CompactUnicodeString<4>;
-#endif
-
 U_NAMESPACE_END
 
 #endif //__NUMPARSE_AFFIXES_H__