From 55a8ab1c8b2d3ff2ad7b3325f87e78b8976a6169 Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 5 Jul 2010 01:15:14 +0000 Subject: port to Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 change makefile to compile for both i386 and x86_64 on Darwin/Mac OS X git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@499 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- tea.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tea.cpp') diff --git a/tea.cpp b/tea.cpp index 60921d4..b1fb6f1 100644 --- a/tea.cpp +++ b/tea.cpp @@ -62,8 +62,14 @@ void XTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by word32 y, z; Block::Get(inBlock)(y)(z); +#ifdef __SUNPRO_CC + // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 + size_t sum = 0; + while ((sum&0xffffffff) != m_limit) +#else word32 sum = 0; while (sum != m_limit) +#endif { y += (z<<4 ^ z>>5) + z ^ sum + m_k[sum&3]; sum += DELTA; @@ -78,8 +84,14 @@ void XTEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by word32 y, z; Block::Get(inBlock)(y)(z); +#ifdef __SUNPRO_CC + // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 + size_t sum = m_limit; + while ((sum&0xffffffff) != 0) +#else word32 sum = m_limit; while (sum != 0) +#endif { z -= (y<<4 ^ y>>5) + y ^ sum + m_k[sum>>11 & 3]; sum -= DELTA; -- cgit v1.2.1