Fix missing SunCC Allocator::max_size(size_type) member function (GH #770)

pull/771/head
Jeffrey Walton 2019-01-01 17:56:26 -05:00
parent 148a5e917b
commit e5085684ef
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 7 additions and 1 deletions

View File

@ -47,7 +47,7 @@ using CryptoPP::byte;
using CryptoPP::word32;
inline byte ARIA_BRF(const word32 x, const int y) {
return GETBYTE(x, y);
return static_cast<byte>(GETBYTE(x, y));
}
ANONYMOUS_NAMESPACE_END

View File

@ -71,6 +71,12 @@ public:
/// to optimize it well in either form.
CRYPTOPP_CONSTEXPR size_type max_size() const {return ELEMS_MAX;}
#if defined(__SUNPRO_CC)
// https://github.com/weidai11/cryptopp/issues/770
// and https://stackoverflow.com/q/53999461/608639
CRYPTOPP_CONSTEXPR size_type max_size(size_type n) const {return (~(size_type)0)/n;}
#endif
#if defined(CRYPTOPP_CXX11_VARIADIC_TEMPLATES) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Constructs a new V using variadic arguments