forked from boostorg/integer
Fix Borland infinite looping issue.
[SVN r39723]
This commit is contained in:
committed by
Peter Dimov
parent
a9d91361fa
commit
307fee457a
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> // for BOOST_NESTED_TEMPLATE, etc.
|
#include <boost/config.hpp> // for BOOST_NESTED_TEMPLATE, etc.
|
||||||
#include <boost/limits.hpp> // for std::numeric_limits
|
#include <boost/limits.hpp> // for std::numeric_limits
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
@ -142,11 +143,18 @@ namespace detail
|
|||||||
// Whittle down the values via their differences
|
// Whittle down the values via their differences
|
||||||
do
|
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
|
// Remove factors of two from the even one
|
||||||
while ( !(r[ which ] & 1u) )
|
while ( !(r[ which ] & 1u) )
|
||||||
{
|
{
|
||||||
r[ which ] >>= 1;
|
r[ which ] >>= 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Replace the larger of the two with their difference
|
// Replace the larger of the two with their difference
|
||||||
if ( r[!which] > r[which] )
|
if ( r[!which] > r[which] )
|
||||||
|
Reference in New Issue
Block a user