From d23af4f0728431b97a3566559477fe02d18d2a73 Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Sun, 27 May 2018 03:07:57 +0000 Subject: [PATCH] ICU-13788 Fix compiler error C4251 on Windows (MSVC, Clang, MinGW). X-SVN-Rev: 41470 --- icu4c/source/i18n/numparse_affixes.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/icu4c/source/i18n/numparse_affixes.h b/icu4c/source/i18n/numparse_affixes.h index 1a90b31b3e..be8c4fb564 100644 --- a/icu4c/source/i18n/numparse_affixes.h +++ b/icu4c/source/i18n/numparse_affixes.h @@ -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; +template class U_I18N_API MaybeStackArray; +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; -template class U_I18N_API MaybeStackArray; -template class U_I18N_API numparse::impl::CompactUnicodeString<4>; -#endif - U_NAMESPACE_END #endif //__NUMPARSE_AFFIXES_H__