From 56a91ca1971d8e8df8bde1fcec512ddb93b72bbf Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 3 Dec 2016 21:31:22 -0500 Subject: [PATCH] Remove last of macros targtting _MSC_VER 1200 (Issue 342) --- gcm.cpp | 2 +- ida.cpp | 22 +++++++++++----------- zdeflate.cpp | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gcm.cpp b/gcm.cpp index a7f9f494..362c358a 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -255,7 +255,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const else tableSize = (GetTablesOption() == GCM_64K_Tables) ? 64*1024 : 2*1024; -#if defined(_MSC_VER) && (_MSC_VER >= 1300 && _MSC_VER < 1400) +#if defined(_MSC_VER) && (_MSC_VER < 1400) // VC 2003 workaround: compiler generates bad code for 64K tables tableSize = 2*1024; #endif diff --git a/ida.cpp b/ida.cpp index 64bcf968..cecee352 100644 --- a/ida.cpp +++ b/ida.cpp @@ -4,19 +4,27 @@ #include "config.h" #include "ida.h" +#include "stdcpp.h" #include "algebra.h" #include "gf2_32.h" #include "polynomi.h" #include "polynomi.cpp" -#include - ANONYMOUS_NAMESPACE_BEGIN -static const CryptoPP::GF2_32 field; +const CryptoPP::GF2_32 field; NAMESPACE_END NAMESPACE_BEGIN(CryptoPP) +#if (defined(_MSC_VER) && (_MSC_VER < 1400)) && !defined(__MWERKS__) + // VC60 and VC7 workaround: built-in reverse_iterator has two template parameters, Dinkumware only has one + typedef std::reverse_bidirectional_iterator RevIt; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator RevIt; +#else + typedef std::reverse_iterator RevIt; +#endif + void RawIDA::IsolatedInitialize(const NameValuePairs ¶meters) { if (!parameters.GetIntValue("RecoveryThreshold", m_threshold)) @@ -394,14 +402,6 @@ size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bo m_possiblePadding = false; } -#if defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__MWERKS__) - // VC60 and VC7 workaround: built-in reverse_iterator has two template parameters, Dinkumware only has one - typedef std::reverse_bidirectional_iterator RevIt; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator RevIt; -#else - typedef std::reverse_iterator RevIt; -#endif const byte *x = std::find_if(RevIt(end), RevIt(begin), std::bind2nd(std::not_equal_to(), byte(0))).base(); if (x != begin && *(x-1) == 1) { diff --git a/zdeflate.cpp b/zdeflate.cpp index 15ae2de7..b8ce89c3 100644 --- a/zdeflate.cpp +++ b/zdeflate.cpp @@ -12,6 +12,15 @@ NAMESPACE_BEGIN(CryptoPP) +#if (defined(_MSC_VER) && (_MSC_VER < 1400)) && !defined(__MWERKS__) + // VC60 and VC7 workaround: built-in std::reverse_iterator has two template parameters, Dinkumware only has one + typedef std::reverse_bidirectional_iterator RevIt; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator RevIt; +#else + typedef std::reverse_iterator RevIt; +#endif + LowFirstBitWriter::LowFirstBitWriter(BufferedTransformation *attachment) : Filter(attachment), m_counting(false), m_bitCount(0), m_buffer(0) , m_bitsBuffered(0), m_bytesBuffered(0) @@ -661,15 +670,6 @@ void Deflator::EncodeBlock(bool eof, unsigned int blockType) { if (blockType == DYNAMIC) { -#if defined(_MSC_VER) && !defined(__MWERKS__) && (_MSC_VER <= 1300) - // VC60 and VC7 workaround: built-in std::reverse_iterator has two template parameters, Dinkumware only has one - typedef std::reverse_bidirectional_iterator RevIt; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator RevIt; -#else - typedef std::reverse_iterator RevIt; -#endif - FixedSizeSecBlock literalCodeLengths; FixedSizeSecBlock distanceCodeLengths;