summaryrefslogtreecommitdiff
path: root/seckey.h
diff options
context:
space:
mode:
authorCrayon2000 <crayon1@rocketmail.com>2016-01-10 22:39:01 -0500
committerCrayon2000 <crayon1@rocketmail.com>2016-01-11 22:21:30 -0500
commit602eb5fa0b742b00543205a74f748206bf83d40d (patch)
treee6118f1412f54a92b9d3bcef7c72c35b7e89f988 /seckey.h
parent405af0aeef41af4b9d95652001e106533036d6d6 (diff)
downloadcryptopp-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.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/seckey.h b/seckey.h
index f8bdaeda..01176913 100644
--- a/seckey.h
+++ b/seckey.h
@@ -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