summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-10-29 23:17:45 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-10-29 23:17:45 +0000
commitc7c8d888049595bc8712f1bf8d881a1897969aab (patch)
tree4964ce6d6a2449f6a7e9459a8927517e6d2c0c68
parentbd44bbdc0e4657aa931bb3ddc42ea9f8337016df (diff)
downloadbcm5719-llvm-c7c8d888049595bc8712f1bf8d881a1897969aab.tar.gz
bcm5719-llvm-c7c8d888049595bc8712f1bf8d881a1897969aab.zip
* Fix compilation on AIX: GCC's fixincludes eliminates isinf() declaration
* Move file comment to the top of the header where it belongs llvm-svn: 17349
-rw-r--r--llvm/lib/Support/IsInf.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Support/IsInf.cpp b/llvm/lib/Support/IsInf.cpp
index 7087dd94c14..e2943b05b58 100644
--- a/llvm/lib/Support/IsInf.cpp
+++ b/llvm/lib/Support/IsInf.cpp
@@ -1,4 +1,4 @@
-//===-- IsInf.cpp ---------------------------------------------------------===//
+//===-- IsInf.cpp - Platform-independent wrapper around C99 isinf() -------===//
//
// The LLVM Compiler Infrastructure
//
@@ -6,12 +6,9 @@
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-//
-// Platform-independent wrapper around C99 isinf().
-//
-//===----------------------------------------------------------------------===//
#include "llvm/Config/config.h"
+
#if HAVE_ISINF_IN_MATH_H
# include <math.h>
#elif HAVE_ISINF_IN_CMATH
@@ -27,6 +24,11 @@ static int isinf(double x) { return !finite(x) && x==x; }
#elif defined(_MSC_VER)
#include <float.h>
#define isinf(X) (!_finite(X))
+#elif defined(_AIX) && defined(__GNUC__)
+// GCC's fixincludes seems to be removing the isinf() declaration from the
+// system header /usr/include/math.h
+# include <math.h>
+static int isinf(double x) { return !finite(x) && x==x; }
#else
# error "Don't know how to get isinf()"
#endif
OpenPOWER on IntegriCloud