Fix constexpr issues under GCC 4.1.2 found on CentOS 5

pull/462/head
Jeffrey Walton 2017-08-17 18:35:06 -04:00
parent 51fe8a7776
commit 1267c75369
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 4 additions and 2 deletions

4
misc.h
View File

@ -109,7 +109,9 @@
# define SIZE_MAX __SIZE_MAX__
# elif defined(SIZE_T_MAX) && (SIZE_T_MAX > 0)
# define SIZE_MAX SIZE_T_MAX
# else
# elif defined(__SIZE_TYPE__)
# define SIZE_MAX (~(__SIZE_TYPE__)0)
#else
# define SIZE_MAX ((std::numeric_limits<size_t>::max)())
# endif
#endif

View File

@ -515,7 +515,7 @@ public:
#if defined(CRYPTOPP_CXX11) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
enum : size_type { ELEMS_MAX = A::ELEMS_MAX };
#else
static const size_type ELEMS_MAX = A::ELEMS_MAX;
static const size_type ELEMS_MAX = SIZE_MAX/sizeof(T);
#endif
//! \brief Construct a SecBlock with space for size elements.