1 //===-- IsInf.cpp ---------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // Platform-independent wrapper around C99 isinf().
12 //===----------------------------------------------------------------------===//
14 #include "Config/config.h"
15 #if HAVE_ISINF_IN_MATH_H
17 #elif HAVE_ISINF_IN_CMATH
19 #elif HAVE_STD_ISINF_IN_CMATH
22 #elif HAVE_FINITE_IN_IEEEFP_H
23 // A handy workaround I found at http://www.unixguide.net/sun/faq ...
24 // apparently this has been a problem with Solaris for years.
26 static int isinf(double x) { return !finite(x) && x==x; }
28 # error "Don't know how to get isinf()"
33 int IsInf (float f) { return isinf (f); }
34 int IsInf (double d) { return isinf (d); }
36 }; // end namespace llvm;