improve portability to minix, patch by
authorChris Lattner <sabre@nondot.org>
Fri, 26 Mar 2010 23:54:15 +0000 (23:54 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 26 Mar 2010 23:54:15 +0000 (23:54 +0000)
Kees van Reeuwijk for PR6704

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99677 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index e4e3296a00041e27cfd3326a9061477250f36b1a..50025d214bcbe23c45a2baf2746c126fae8ae677 100644 (file)
@@ -1382,8 +1382,8 @@ APInt APInt::sqrt() const {
   // libc sqrt function which will probably use a hardware sqrt computation.
   // This should be faster than the algorithm below.
   if (magnitude < 52) {
   // libc sqrt function which will probably use a hardware sqrt computation.
   // This should be faster than the algorithm below.
   if (magnitude < 52) {
-#ifdef _MSC_VER
-    // Amazingly, VC++ doesn't have round().
+#if defined( _MSC_VER ) || defined(_MINIX)
+    // Amazingly, VC++ and Minix don't have round().
     return APInt(BitWidth,
                  uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0]))) + 0.5);
 #else
     return APInt(BitWidth,
                  uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0]))) + 0.5);
 #else