summaryrefslogtreecommitdiff
path: root/lib/Support/IsInf.cpp
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
commit9437db4e785b973efa622c45b586fafb88b47079 (patch)
tree4dde5925e748e4235031b570353f295ed258d47d /lib/Support/IsInf.cpp
parent7614e5130b22884b48bec0197508676ff3554d39 (diff)
downloadllvm-9437db4e785b973efa622c45b586fafb88b47079.tar.gz
llvm-9437db4e785b973efa622c45b586fafb88b47079.tar.bz2
llvm-9437db4e785b973efa622c45b586fafb88b47079.tar.xz
* Fix compilation on AIX: GCC's fixincludes eliminates isinf() declaration
* Move file comment to the top of the header where it belongs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/IsInf.cpp')
-rw-r--r--lib/Support/IsInf.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Support/IsInf.cpp b/lib/Support/IsInf.cpp
index 7087dd94c1..e2943b05b5 100644
--- a/lib/Support/IsInf.cpp
+++ b/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