Make NumericLimitsMin and NumericLimitsMax available to MSVC (Issue 364)

This commit is contained in:
Jeffrey Walton 2017-01-15 19:36:36 -05:00
parent b274f06202
commit 1d391c190d
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

7
misc.h
View File

@ -116,8 +116,8 @@
#endif // CRYPTOPP_DOXYGEN_PROCESSING
// http://github.com/weidai11/cryptopp/issues/364
#if defined(CRYPTOPP_WORD128_AVAILABLE)
// NumericLimitsMin and NumericLimitsMax added for word128 types,
// see http://github.com/weidai11/cryptopp/issues/364
ANONYMOUS_NAMESPACE_BEGIN
template<class T>
T NumericLimitsMin()
@ -131,6 +131,7 @@ T NumericLimitsMax()
CRYPTOPP_ASSERT(std::numeric_limits<T>::is_specialized);
return std::numeric_limits<T>::max();
};
#if defined(CRYPTOPP_WORD128_AVAILABLE)
template<>
CryptoPP::word128 NumericLimitsMin()
{
@ -141,8 +142,8 @@ CryptoPP::word128 NumericLimitsMax()
{
return (((CryptoPP::word128)W64LIT(0xffffffffffffffff)) << 64U) | (CryptoPP::word128)W64LIT(0xffffffffffffffff);
}
ANONYMOUS_NAMESPACE_END
#endif
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)