From eba7dd28462e91fcc8a40ec5b90e3f24fd1e05d3 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Fri, 8 Jan 2016 20:00:17 -0500 Subject: [PATCH 1/3] Added C++Builder section in .gitignore file --- .gitignore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 0539a4a7..5ce3483e 100644 --- a/.gitignore +++ b/.gitignore @@ -254,3 +254,21 @@ pip-log.txt #Mr Developer .mr.developer.cfg +################# +## C++Builder +################# + +## Ignore C++Builder temporary files and build results. +## http://docwiki.embarcadero.com/RADStudio/en/File_Extensions_of_Files_Generated_by_RAD_Studio + +# Static library file +*.lib + +# User-specific project options +*.local + +# Compiled resource file +*.res + +# Dependency file +*.d From 51ec011a60252f42c8763953486ea8145dda8df8 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Sat, 9 Jan 2016 14:12:56 -0500 Subject: [PATCH 2/3] Removed *.res from .gitignore It was recommended by noloader: https://github.com/weidai11/cryptopp/pull/107#issuecomment-170243489 --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5ce3483e..15d93060 100644 --- a/.gitignore +++ b/.gitignore @@ -267,8 +267,5 @@ pip-log.txt # User-specific project options *.local -# Compiled resource file -*.res - # Dependency file *.d From c4aaf081f9370e473805fbd15ba8e20a479467a2 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Sun, 10 Jan 2016 22:39:01 -0500 Subject: [PATCH 3/3] 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 --- misc.h | 2 +- seckey.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/misc.h b/misc.h index 090b2972..2f165e3e 100644 --- a/misc.h +++ b/misc.h @@ -1,4 +1,4 @@ -// misc.h - written and placed in the public domain by Wei Dai +// misc.h - written and placed in the public domain by Wei Dai //! \file misc.h //! \brief Utility functions for the Crypto++ library. 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,10 +194,12 @@ 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;