5ed3971254bb374e7f9ef4152c8b94a810c7e326
[oota-llvm.git] / lib / Support / IsNAN.cpp
1 //===-- IsNAN.cpp ---------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Platform-independent wrapper around C99 isnan().
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/Config/config.h"
15 #include "llvm/System/IncludeFile.h"
16
17 #if HAVE_ISNAN_IN_MATH_H
18 # include <math.h>
19 #elif HAVE_ISNAN_IN_CMATH
20 # include <cmath>
21 #elif HAVE_STD_ISNAN_IN_CMATH
22 # include <cmath>
23 using std::isnan;
24 #elif defined(_MSC_VER)
25 #include <float.h>
26 #define isnan _isnan
27 #else
28 # error "Don't know how to get isnan()"
29 #endif
30
31 namespace llvm {
32
33 int IsNAN (float f)  { return isnan (f); }
34 int IsNAN (double d) { return isnan (d); }
35
36 } // end namespace llvm;
37
38 DEFINING_FILE_FOR(SupportIsNAN)