MSVC has no std::isnan

This commit is contained in:
Frederic Bouvier 2012-09-26 08:36:56 +02:00
parent 25130e3c82
commit 98ca36e8f5

View File

@ -20,6 +20,10 @@
#include <simgear/constants.h> #include <simgear/constants.h>
#ifndef _MSC_VER
using std::isnan;
#endif
// #define SG_GEOD_NATIVE_DEGREE // #define SG_GEOD_NATIVE_DEGREE
/// Class representing a geodetic location /// Class representing a geodetic location
@ -352,7 +356,7 @@ inline
bool bool
SGGeod::isValid() const SGGeod::isValid() const
{ {
if (std::isnan(_lon) || std::isnan(_lat)) return false; if (isnan(_lon) || isnan(_lat)) return false;
#ifdef SG_GEOD_NATIVE_DEGREE #ifdef SG_GEOD_NATIVE_DEGREE
return (_lon >= -180.0) && (_lon <= 180.0) && return (_lon >= -180.0) && (_lon <= 180.0) &&
(_lat >= -90.0) && (_lat <= 90.0); (_lat >= -90.0) && (_lat <= 90.0);