Merge pull request #15 from jefgen/jefgen/disable-warning-for-MSVC

Disable warning 4661 for MSVC for NumberFormatterSettings and [Un]loc…
This commit is contained in:
Shane F. Carr 2020-01-31 18:12:52 -08:00 committed by GitHub
commit 4b2e49e547
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 0 deletions

View file

@ -20,6 +20,16 @@ using namespace icu;
using namespace icu::number;
using namespace icu::number::impl;
#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
// Ignore MSVC warning 4661. This is generated for NumberFormatterSettings<>::toSkeleton() as this method
// is defined elsewhere (in number_skeletons.cpp). The compiler is warning that the explicit template instantiation
// inside this single translation unit (CPP file) is incomplete, and thus it isn't sure if the template class is
// fully defined. However, since each translation unit explicitly instantiates all the necessary template classes,
// they will all be passed to the linker, and the linker will still find and export all the class members.
#pragma warning(push)
#pragma warning(disable: 4661)
#endif
template<typename Derived>
Derived NumberFormatterSettings<Derived>::notation(const Notation& notation) const& {
Derived copy(*this);
@ -750,5 +760,9 @@ int32_t LocalizedNumberFormatter::getCallCount() const {
// Note: toFormat defined in number_asformat.cpp
#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
// Warning 4661.
#pragma warning(pop)
#endif
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -30,6 +30,16 @@ using namespace icu::number;
using namespace icu::number::impl;
using namespace icu::number::impl::skeleton;
#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
// Ignore MSVC warning 4661. This is generated for NumberFormatterSettings<>::toSkeleton() as this method
// is defined elsewhere (in number_skeletons.cpp). The compiler is warning that the explicit template instantiation
// inside this single translation unit (CPP file) is incomplete, and thus it isn't sure if the template class is
// fully defined. However, since each translation unit explicitly instantiates all the necessary template classes,
// they will all be passed to the linker, and the linker will still find and export all the class members.
#pragma warning(push)
#pragma warning(disable: 4661)
#endif
namespace {
icu::UInitOnce gNumberSkeletonsInitOnce = U_INITONCE_INITIALIZER;
@ -1717,5 +1727,9 @@ NumberFormatter::forSkeleton(const UnicodeString& skeleton, UParseError& perror,
return skeleton::create(skeleton, &perror, status);
}
#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
// Warning 4661.
#pragma warning(pop)
#endif
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -1439,6 +1439,16 @@ struct U_I18N_API MacroProps : public UMemory {
} // namespace impl
#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
// Ignore MSVC warning 4661. This is generated for NumberFormatterSettings<>::toSkeleton() as this method
// is defined elsewhere (in number_skeletons.cpp). The compiler is warning that the explicit template instantiation
// inside this single translation unit (CPP file) is incomplete, and thus it isn't sure if the template class is
// fully defined. However, since each translation unit explicitly instantiates all the necessary template classes,
// they will all be passed to the linker, and the linker will still find and export all the class members.
#pragma warning(push)
#pragma warning(disable: 4661)
#endif
/**
* An abstract base class for specifying settings related to number formatting. This class is implemented by
* {@link UnlocalizedNumberFormatter} and {@link LocalizedNumberFormatter}. This class is not intended for
@ -2405,6 +2415,11 @@ class U_I18N_API LocalizedNumberFormatter
friend class UnlocalizedNumberFormatter;
};
#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
// Warning 4661.
#pragma warning(pop)
#endif
/**
* The result of a number formatting operation. This class allows the result to be exported in several data types,
* including a UnicodeString and a FieldPositionIterator.