Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-10-06 07:12:34


Author: johnmaddock
Date: 2007-10-06 07:12:33 EDT (Sat, 06 Oct 2007)
New Revision: 39723
URL: http://svn.boost.org/trac/boost/changeset/39723

Log:
Fix Borland infinite looping issue.
Text files modified:
   trunk/boost/math/common_factor_rt.hpp | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/boost/math/common_factor_rt.hpp
==============================================================================
--- trunk/boost/math/common_factor_rt.hpp (original)
+++ trunk/boost/math/common_factor_rt.hpp 2007-10-06 07:12:33 EDT (Sat, 06 Oct 2007)
@@ -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 @@
             // 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] )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk