LLVM API Documentation
00001 //===-- IsNAN.cpp ---------------------------------------------------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // Platform-independent wrapper around C99 isnan(). 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #include "llvm/Config/config.h" 00015 #if HAVE_ISNAN_IN_MATH_H 00016 # include <math.h> 00017 #elif HAVE_ISNAN_IN_CMATH 00018 # include <cmath> 00019 #elif HAVE_STD_ISNAN_IN_CMATH 00020 # include <cmath> 00021 using std::isnan; 00022 #elif defined(_MSC_VER) 00023 #include <float.h> 00024 #define isnan _isnan 00025 #else 00026 # error "Don't know how to get isnan()" 00027 #endif 00028 00029 namespace llvm { 00030 00031 int IsNAN (float f) { return isnan (f); } 00032 int IsNAN (double d) { return isnan (d); } 00033 00034 }; // end namespace llvm;