void f() { isnan(0.0);} "
HAVE_ISNAN)
+check_cxx_source_compiles(
+ "#include <cmath>
+ void f() { std::isnan(0.0);} "
+ HAVE_STD_ISNAN)
+
if(CMAKE_COMPILER_IS_GNUCXX)
set(WARNING_FLAGS_CXX "-Wall")
set(WARNING_FLAGS_C "-Wall")
#include <simgear/constants.h>
-#ifndef _MSC_VER
-using std::isnan;
-#endif
-
// #define SG_GEOD_NATIVE_DEGREE
/// Class representing a geodetic location
bool
SGGeod::isValid() const
{
- if (isnan(_lon) || isnan(_lat)) return false;
+ if (SGMiscd::isNaN(_lon))
+ return false;
+ if (SGMiscd::isNaN(_lat))
+ return false;
#ifdef SG_GEOD_NATIVE_DEGREE
return (_lon >= -180.0) && (_lon <= 180.0) &&
(_lat >= -90.0) && (_lat <= 90.0);
static S lerp(const S& val0, const S& val1, const T& t)
{ return val0*(T(1) - t) + val1*t; }
-#ifndef NDEBUG
/// Returns true if v is a NaN value
/// Use with care: allways code that you do not need to use that!
static bool isNaN(const T& v)
return !(v == v);
#endif
}
-#endif
};
#endif
#cmakedefine HAVE_RINT
#cmakedefine HAVE_TIMEGM
#cmakedefine HAVE_ISNAN
+#cmakedefine HAVE_STD_ISNAN
#cmakedefine HAVE_WINDOWS_H
#cmakedefine HAVE_MKDTEMP