From be0cd5733a9c48896ced499ecc8bf0b15bd9560f Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Mon, 11 May 2015 09:36:40 -0700 Subject: gps: gpsd: Fix MSVC std::isnan() fail by using boost::math::isnan(). Signed-off-by: Moritz Fischer --- host/lib/usrp/gpsd_iface.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/gpsd_iface.cpp b/host/lib/usrp/gpsd_iface.cpp index dbf04c348..e0a1dea05 100644 --- a/host/lib/usrp/gpsd_iface.cpp +++ b/host/lib/usrp/gpsd_iface.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -173,7 +174,7 @@ private: // member functions float _zeroize(float x) { - return std::isnan(x) ? 0.0 : x; + return boost::math::isnan(x) ? 0.0 : x; } int _nmea_checksum(const std::string &s) @@ -205,7 +206,7 @@ private: // member functions tm.tm_mday = tm.tm_mon = tm.tm_year = 0; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; - if (std::isnan(_gps_data.fix.time) == 0) { + if (boost::math::isnan(_gps_data.fix.time) == 0) { intfixtime = (time_t) _gps_data.fix.time; (void)gmtime_r(&intfixtime, &tm); tm.tm_mon++; @@ -256,25 +257,25 @@ private: // member functions % _gps_data.status % _gps_data.satellites_used); - if (std::isnan(_gps_data.dop.hdop)) + if (boost::math::isnan(_gps_data.dop.hdop)) string.append(","); else string.append( str(boost::format("%.2f,") % _gps_data.dop.hdop)); - if (std::isnan(_gps_data.fix.altitude)) + if (boost::math::isnan(_gps_data.fix.altitude)) string.append(","); else string.append( str(boost::format("%.2f,M,") % _gps_data.fix.altitude)); - if (std::isnan(_gps_data.separation)) + if (boost::math::isnan(_gps_data.separation)) string.append(","); else string.append( str(boost::format("%.3f,M,") % _gps_data.separation)); - if (std::isnan(mag_var)) + if (boost::math::isnan(mag_var)) string.append(","); else { string.append( -- cgit v1.2.3