1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Add local definition of to_time_t to be compatible with Boost < 1.58

This commit is contained in:
Carles Fernandez 2018-11-07 19:27:26 +01:00
parent 234c770f66
commit 3477f41198
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 9 additions and 3 deletions

View File

@ -36,7 +36,6 @@
#include "gnss_sdr_create_directory.h"
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/exception/all.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/serialization/map.hpp>
@ -47,7 +46,6 @@
#include <iostream>
#include <map>
#include <exception>
#include <boost/date_time/posix_time/conversion.hpp>
#if OLD_BOOST
#include <boost/math/common_factor_rt.hpp>
namespace bc = boost::math;
@ -909,7 +907,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg,
*height_m = d_ls_pvt->get_height();
*ground_speed_kmh = d_ls_pvt->get_speed_over_ground() * 3600.0 / 1000.0;
*course_over_ground_deg = d_ls_pvt->get_course_over_ground();
*UTC_time = boost::posix_time::to_time_t(d_ls_pvt->get_position_UTC_time());
*UTC_time = to_time_t(d_ls_pvt->get_position_UTC_time());
return true;
}
@ -919,6 +917,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg,
}
}
int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items __attribute__((unused)))
{

View File

@ -40,6 +40,8 @@
#include "rtcm_printer.h"
#include "pvt_conf.h"
#include "rtklib_solver.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <gnuradio/sync_block.h>
#include <sys/types.h>
#include <sys/ipc.h>
@ -135,6 +137,11 @@ private:
bool d_xml_storage;
std::string xml_base_path;
inline std::time_t to_time_t(boost::posix_time::ptime pt)
{
return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds();
}
public:
rtklib_pvt_cc(uint32_t nchannels,