Index: lib/Support/APInt.cpp
===================================================================
--- lib/Support/APInt.cpp	(revision 37850)
+++ lib/Support/APInt.cpp	(working copy)
@@ -1307,15 +1307,12 @@
   // an IEEE double precision floating point value), then we can use the
   // libc sqrt function which will probably use a hardware sqrt computation.
   // This should be faster than the algorithm below.
+  // using floor(0.5 + x) instead of round(x) because latter is C99.
   if (magnitude < 52) {
-#ifdef _MSC_VER
-    // Amazingly, VC++ doesn't have round().
     return APInt(BitWidth, 
-                 uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0]))) + 0.5);
-#else
-    return APInt(BitWidth, 
-                 uint64_t(::round(::sqrt(double(isSingleWord()?VAL:pVal[0])))));
-#endif
+                 uint64_t(::floor(0.5
+								  + ::sqrt(::floor(0.5
+												   + isSingleWord()?VAL:pVal[0])))));
   }
 
   // Okay, all the short cuts are exhausted. We must compute it. The following
