[llvm-commits] CVS: llvm/lib/Support/IsNAN.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Tue Jun 22 19:03:01 PDT 2004


Changes in directory llvm/lib/Support:

IsNAN.cpp added (r1.1)

---
Log message:

Wrapper for c99 isnan()


---
Diffs of the changes:  (+31 -0)

Index: llvm/lib/Support/IsNAN.cpp
diff -c /dev/null llvm/lib/Support/IsNAN.cpp:1.1
*** /dev/null	Tue Jun 22 18:54:48 2004
--- llvm/lib/Support/IsNAN.cpp	Tue Jun 22 18:54:38 2004
***************
*** 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;





More information about the llvm-commits mailing list