From 0ba723ded25a938c8f153bbf2159155119fe2119 Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Wed, 31 Mar 2021 16:24:37 +0000 Subject: [PATCH] ICU-21563 Fix delete-incomplete on windows See #1671 --- icu4c/source/i18n/measunit_impl.h | 42 +++++++++++++++++-------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/icu4c/source/i18n/measunit_impl.h b/icu4c/source/i18n/measunit_impl.h index f88d9000883..c86176348c9 100644 --- a/icu4c/source/i18n/measunit_impl.h +++ b/icu4c/source/i18n/measunit_impl.h @@ -20,22 +20,6 @@ class LongNameHandler; } } // namespace number -// Export an explicit template instantiation of the LocalPointer that is used as a -// data member of MeasureUnitImpl. -// (When building DLLs for Windows this is required.) -#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN -#if defined(_MSC_VER) -// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!= -#pragma warning(push) -#pragma warning(disable : 4661) -#endif -template class U_I18N_API LocalPointerBase; -template class U_I18N_API LocalPointer; -#if defined(_MSC_VER) -#pragma warning(pop) -#endif -#endif - static const char16_t kDefaultCurrency[] = u"XXX"; static const char kDefaultCurrency8[] = "XXX"; @@ -194,9 +178,6 @@ struct MeasureUnitImplWithIndex; template class U_I18N_API MaybeStackArray; template class U_I18N_API MemoryPool; template class U_I18N_API MaybeStackVector; -template class U_I18N_API MaybeStackArray; -template class U_I18N_API MemoryPool; -template class U_I18N_API MaybeStackVector; #endif /** @@ -330,6 +311,29 @@ struct U_I18N_API MeasureUnitImplWithIndex : public UMemory { } }; +// Export explicit template instantiations of MaybeStackArray, MemoryPool and +// MaybeStackVector. This is required when building DLLs for Windows. (See +// datefmt.h, collationiterator.h, erarules.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 MemoryPool; +template class U_I18N_API MaybeStackVector; + +// Export an explicit template instantiation of the LocalPointer that is used as a +// data member of MeasureUnitImpl. +// (When building DLLs for Windows this is required.) +#if defined(_MSC_VER) +// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!= +#pragma warning(push) +#pragma warning(disable : 4661) +#endif +template class U_I18N_API LocalPointerBase; +template class U_I18N_API LocalPointer; +#if defined(_MSC_VER) +#pragma warning(pop) +#endif +#endif + U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ -- 2.40.0