pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmocom-bb/+/16848 )
Change subject: layer23: Fix build against gpsd >= 3.20
......................................................................
layer23: Fix build against gpsd >= 3.20
During 3.19->3.20 dev cycle, some fields were transformed from
timestamp_t or double to timespec_t. See for instance gpsd.git
f7c230fceb6d64483757f8c32afb98e6a2cb9413.
Change-Id: Ie8ba19d030b6f46f2d8afc270a732ce8c26c438f
---
M src/host/layer23/src/common/gps.c
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/48/16848/1
diff --git a/src/host/layer23/src/common/gps.c
b/src/host/layer23/src/common/gps.c
index 35ee416..807beed 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -82,7 +82,11 @@
g.valid = 0;
/* gps is offline */
+#if GPSD_API_MAJOR_VERSION >= 9 && GPSD_API_MINOR_VERSION >= 0
+ if (gdata->online.tv_sec || gdata->online.tv_nsec)
+#else
if (gdata->online)
+#endif
goto gps_not_ready;
#if GPSD_API_MAJOR_VERSION >= 5
@@ -102,7 +106,11 @@
/* data are valid */
if (gdata->set & LATLON_SET) {
g.valid = 1;
+#if GPSD_API_MAJOR_VERSION >= 9 && GPSD_API_MINOR_VERSION >= 0
+ g.gmt = gdata->fix.time.tv_sec;
+#else
g.gmt = gdata->fix.time;
+#endif
tm = localtime(&g.gmt);
diff = time(NULL) - g.gmt;
g.latitude = gdata->fix.latitude;
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/16848
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie8ba19d030b6f46f2d8afc270a732ce8c26c438f
Gerrit-Change-Number: 16848
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange