diff options
author | Moritz Fischer <moritz.fischer@ettus.com> | 2015-05-11 09:36:40 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-07-29 18:13:45 -0700 |
commit | be0cd5733a9c48896ced499ecc8bf0b15bd9560f (patch) | |
tree | 768dbd1f6d00db880fc84d1093f57d10cb7f2030 | |
parent | 9d22206acbb9048be353dd67ebddb42d63a7a942 (diff) | |
download | uhd-be0cd5733a9c48896ced499ecc8bf0b15bd9560f.tar.gz uhd-be0cd5733a9c48896ced499ecc8bf0b15bd9560f.tar.bz2 uhd-be0cd5733a9c48896ced499ecc8bf0b15bd9560f.zip |
gps: gpsd: Fix MSVC std::isnan() fail by using boost::math::isnan().
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
-rw-r--r-- | host/lib/usrp/gpsd_iface.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
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 <boost/lexical_cast.hpp> #include <boost/thread/shared_mutex.hpp> #include <boost/thread.hpp> +#include <boost/math/special_functions/fpclassify.hpp> #include <uhd/exception.hpp> #include <uhd/usrp/gps_ctrl.hpp> @@ -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( |