Fix Borland infinite looping issue.

[SVN r39723]
This commit is contained in:
John Maddock
2007-10-06 11:12:33 +00:00
committed by Peter Dimov
parent a9d91361fa
commit 307fee457a

View File

@ -15,6 +15,7 @@
#include <boost/config.hpp> // for BOOST_NESTED_TEMPLATE, etc.
#include <boost/limits.hpp> // for std::numeric_limits
#include <boost/detail/workaround.hpp>
namespace boost
@ -142,11 +143,18 @@ namespace detail
// Whittle down the values via their differences
do
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
while ( !(r[ which ] & 1u) )
{
r[ which ] = (r[which] >> 1);
}
#else
// Remove factors of two from the even one
while ( !(r[ which ] & 1u) )
{
r[ which ] >>= 1;
}
#endif
// Replace the larger of the two with their difference
if ( r[!which] > r[which] )