aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-06-22 23:54:38 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-06-22 23:54:38 +0000
commit30135b2c816718e63630b9b42723883fc58f48fe (patch)
treef5711602af6260bdcf3ccf7ab5bfa049c10a3249 /lib/Support
parent5c039879649f12c17f6c52c08be9a82d838525f9 (diff)
downloadexternal_llvm-30135b2c816718e63630b9b42723883fc58f48fe.zip
external_llvm-30135b2c816718e63630b9b42723883fc58f48fe.tar.gz
external_llvm-30135b2c816718e63630b9b42723883fc58f48fe.tar.bz2
Wrapper for c99 isnan()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/IsNAN.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/Support/IsNAN.cpp b/lib/Support/IsNAN.cpp
new file mode 100644
index 0000000..ade6bf1
--- /dev/null
+++ b/lib/Support/IsNAN.cpp
@@ -0,0 +1,31 @@
+//===-- IsNAN.cpp ---------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Platform-independent wrapper around C99 isnan().
+//
+//===----------------------------------------------------------------------===//
+
+#include "Config/config.h"
+#if HAVE_ISNAN_IN_MATH_H
+# include <math.h>
+#elif HAVE_ISNAN_IN_CMATH
+# include <cmath>
+#elif HAVE_STD_ISNAN_IN_CMATH
+# include <cmath>
+using std::isnan;
+#else
+# error "Don't know how to get isnan()"
+#endif
+
+namespace llvm {
+
+int IsNAN (float f) { return isnan (f); }
+int IsNAN (double d) { return isnan (d); }
+
+}; // end namespace llvm;