ROSE  0.9.9.168
rose_isnan.h
1 #ifndef ROSE_isnan_H
2 #define ROSE_isnan_H
3 
4 #if 0
5  #warning "__GNUC__ = "__GNUC__
6  #ifdef __GNUC__
7  #warning "__GNUC__ is defined = "__GNUC__
8  #else
9  #warning "__GNUC__ is not defined"
10  #endif
11 #endif
12 
13 #if (__GNUC__ < 6)
14 #include <cmath>
15 
16 // #warning "__GNUC__ < 6"
17 // #warning "__cplusplus = "__cplusplus
18 
19 // MS 2016: isnan is available in C++11 std namespace, but not in C++98
20 // std namespace. On *some* systems C++11 cmath puts it inside *and* outside the std
21 // namespace.
22 #if __cplusplus >= 201103L
23  #define rose_isnan(x) std::isnan(x)
24 #else
25  #ifdef _MSC_VER
26  #include <float.h> // for _isnan
27  #define rose_isnan(x) _isnan(x)
28  #else
29  #define rose_isnan(x) isnan(x)
30  #endif
31 #endif
32 
33 #else
34 
35 // #warning "__GNUC__ >= 6 (or not defined)"
36 
37 #include <math.h>
38 
39 // DQ (11/16/2017): This is not defined properly for the Intel compiler when qualified
40 // because it will be expanded to an expression:
41 // std::(( sizeof( x ) > sizeof( double )) ? __isnanl( (long double)(x) ) : (( sizeof( x ) == sizeof( float )) ? __isnanf( (float)(x) ) : __isnan( (double)(x) ) ) ).
42 // and qualification of such an expression is not legal syntax.
43 // #define rose_isnan(x) std::isnan(x)
44 #ifdef __INTEL_COMPILER
45  #define rose_isnan(x) isnan(x)
46 #else
47  #define rose_isnan(x) std::isnan(x)
48 #endif
49 
50 #endif
51 
52 #endif