diff options
author | Andrej Rode <andrej.rode@ettus.com> | 2017-02-17 11:37:00 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-04-12 12:15:02 -0700 |
commit | 3634302ff3751bd27aba224e5f6ff51dffd813c3 (patch) | |
tree | bd2cb8fa4c0ab905fee86b2f5f89cae1ade22c0e /host/lib/usrp/gps_ctrl.cpp | |
parent | 18cd5c46fc8463292629e8161f8e0ae905bdb60e (diff) | |
download | uhd-3634302ff3751bd27aba224e5f6ff51dffd813c3.tar.gz uhd-3634302ff3751bd27aba224e5f6ff51dffd813c3.tar.bz2 uhd-3634302ff3751bd27aba224e5f6ff51dffd813c3.zip |
gps_ctrl: yeah windows, my friend
Diffstat (limited to 'host/lib/usrp/gps_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/gps_ctrl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index c1cdadd23..209ded29f 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -30,6 +30,9 @@ #include <boost/thread/mutex.hpp> #include <ctime> #include <string> +#if defined(WIN32) || defined(MINGW) +#define timegm _mkgmtime +#endif #include "boost/tuple/tuple.hpp" @@ -356,7 +359,7 @@ private: raw_date->tm_hour = std::stoi(timestr.substr(0, 2)); raw_date->tm_min = std::stoi(timestr.substr(2, 2)); raw_date->tm_sec = std::stoi(timestr.substr(4,2)); - std::time_t gps_date = mktime(raw_date) - timezone; // mktime creates time_t in localtime + std::time_t gps_date = timegm(raw_date); // GPS time is UTC gps_time = boost::posix_time::from_time_t(gps_date); |