From 3477f41198ec5c079c8fcc2138630a9497b6b3de Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 7 Nov 2018 19:27:26 +0100 Subject: [PATCH] Add local definition of to_time_t to be compatible with Boost < 1.58 --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 5 ++--- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 98202bb68..762a36f1c 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -36,7 +36,6 @@ #include "gnss_sdr_create_directory.h" #include #include -#include #include #include #include @@ -47,7 +46,6 @@ #include #include #include -#include #if OLD_BOOST #include 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))) { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index bf53bfd3d..c26f923d4 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -40,6 +40,8 @@ #include "rtcm_printer.h" #include "pvt_conf.h" #include "rtklib_solver.h" +#include +#include #include #include #include @@ -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,