[llvm-commits] CVS: llvm/lib/Support/IsInf.cpp
Misha Brukman
brukman at cs.uiuc.edu
Fri Oct 29 16:17:56 PDT 2004
Changes in directory llvm/lib/Support:
IsInf.cpp updated: 1.4 -> 1.5
---
Log message:
* Fix compilation on AIX: GCC's fixincludes eliminates isinf() declaration
* Move file comment to the top of the header where it belongs
---
Diffs of the changes: (+7 -5)
Index: llvm/lib/Support/IsInf.cpp
diff -u llvm/lib/Support/IsInf.cpp:1.4 llvm/lib/Support/IsInf.cpp:1.5
--- llvm/lib/Support/IsInf.cpp:1.4 Mon Oct 25 13:47:10 2004
+++ llvm/lib/Support/IsInf.cpp Fri Oct 29 18:17:45 2004
@@ -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 @@
#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
More information about the llvm-commits
mailing list