From 3634302ff3751bd27aba224e5f6ff51dffd813c3 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Fri, 17 Feb 2017 11:37:00 -0800 Subject: gps_ctrl: yeah windows, my friend --- host/lib/usrp/gps_ctrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/gps_ctrl.cpp') 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 #include #include +#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); -- cgit v1.2.3