C++Builder: The problem with the CRYPTOPP_CONSTANT macro was corrected properly

pull/107/head
Crayon2000 2016-01-12 12:29:44 -05:00
parent 249f1b9788
commit 0892ee411b
2 changed files with 1 additions and 3 deletions

View File

@ -449,7 +449,7 @@ NAMESPACE_END
#endif #endif
// how to declare class constants // how to declare class constants
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) || defined(__BORLANDC__)
# define CRYPTOPP_CONSTANT(x) enum {x}; # define CRYPTOPP_CONSTANT(x) enum {x};
#else #else
# define CRYPTOPP_CONSTANT(x) static const int x; # define CRYPTOPP_CONSTANT(x) static const int x;

View File

@ -194,12 +194,10 @@ public:
//! \details keylength is provided in bytes, not bits. //! \details keylength is provided in bytes, not bits.
static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength) static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
{ {
#if !defined(__BORLANDC__)
#if MIN_KEYLENGTH > 0 #if MIN_KEYLENGTH > 0
if (keylength < (size_t)MIN_KEYLENGTH) if (keylength < (size_t)MIN_KEYLENGTH)
return MIN_KEYLENGTH; return MIN_KEYLENGTH;
else else
#endif
#endif #endif
if (keylength > (size_t)MAX_KEYLENGTH) if (keylength > (size_t)MAX_KEYLENGTH)
return (size_t)MAX_KEYLENGTH; return (size_t)MAX_KEYLENGTH;