diff options
author | Crayon2000 <crayon1@rocketmail.com> | 2016-01-10 22:39:01 -0500 |
---|---|---|
committer | Crayon2000 <crayon1@rocketmail.com> | 2016-01-11 22:21:30 -0500 |
commit | 602eb5fa0b742b00543205a74f748206bf83d40d (patch) | |
tree | e6118f1412f54a92b9d3bcef7c72c35b7e89f988 /seckey.h | |
parent | 405af0aeef41af4b9d95652001e106533036d6d6 (diff) | |
download | cryptopp-git-602eb5fa0b742b00543205a74f748206bf83d40d.tar.gz |
The Crypto++ library can now be compiled with C++Builder
Two macro were causing compiler problems with bcc32
[bcc32 Error] seckey.h(83): E2313 Constant expression required
and
[bcc32 Error] seckey.h(194): E2313 Constant expression required
Diffstat (limited to 'seckey.h')
-rw-r--r-- | seckey.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -80,12 +80,15 @@ protected: //! \throws InvalidRounds if the number of rounds are invalid
inline void ThrowIfInvalidRounds(int rounds, const Algorithm *alg)
{
-#if (M==INT_MAX) // Coverity and result_independent_of_operands
+#if defined(__BORLANDC__)
+ if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
+ throw InvalidRounds(alg ? alg->AlgorithmName() : std::string("VariableRounds"), rounds);
+#elif (M==INT_MAX) // Coverity and result_independent_of_operands
if (rounds < MIN_ROUNDS)
throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds);
#else
if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
- throw InvalidRounds(alg ? alg->AlgorithmName() : std::string("VariableRounds"), rounds);
+ throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds);
#endif
}
@@ -191,11 +194,13 @@ public: //! \details keylength is provided in bytes, not bits.
static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
{
+#if !defined(__BORLANDC__)
#if MIN_KEYLENGTH > 0
if (keylength < (size_t)MIN_KEYLENGTH)
return MIN_KEYLENGTH;
else
#endif
+#endif
if (keylength > (size_t)MAX_KEYLENGTH)
return (size_t)MAX_KEYLENGTH;
else
|