summaryrefslogtreecommitdiff
path: root/secblock.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-01-01 17:56:26 -0500
committerJeffrey Walton <noloader@gmail.com>2019-01-01 17:56:26 -0500
commite5085684efe71cb48ccb4385f40cd3cc62d5f66c (patch)
tree747abe9fc4fa6a66650ea09322bfcef4c7dab77e /secblock.h
parent148a5e917bc277572637c8b851b9d4f1417946f7 (diff)
downloadcryptopp-git-e5085684efe71cb48ccb4385f40cd3cc62d5f66c.tar.gz
Fix missing SunCC Allocator::max_size(size_type) member function (GH #770)
Diffstat (limited to 'secblock.h')
-rw-r--r--secblock.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/secblock.h b/secblock.h
index 26ebd0ae..ba70b487 100644
--- a/secblock.h
+++ b/secblock.h
@@ -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