gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] Fix build error when ntpshm is false


From: Simon Dawson
Subject: [gpsd-dev] [PATCH] Fix build error when ntpshm is false
Date: Mon, 25 Aug 2014 10:31:18 +0100

The build fails as follows

libgpsd_core.c: In function 'ntpshm_latch':
libgpsd_core.c:1660:24: error: 'const struct gps_type_t' has no member named 
'time_offset'
  || device->device_type->time_offset == NULL)
                        ^
libgpsd_core.c:1663:33: error: 'const struct gps_type_t' has no member named 
'time_offset'
  fix_time += device->device_type->time_offset(device);
                                 ^
scons: *** [libgpsd_core.os] Error 1

The solution is to wrap #ifdef NTPSHM_ENABLE around the ntpshm_latch function

Signed-off-by: Simon Dawson <address@hidden>
---
 libgpsd_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libgpsd_core.c b/libgpsd_core.c
index 6ec08a4..f7e8075 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1638,6 +1638,7 @@ void gpsd_zero_satellites( /address@hidden@*/ struct 
gps_data_t *out)
 #endif
 }
 
+#ifdef NTPSHM_ENABLE
 void ntpshm_latch(struct gps_device_t *device, struct timedrift_t 
/address@hidden@*/*td)
 /* latch the fact that we've saved a fix */
 {
@@ -1668,5 +1669,6 @@ void ntpshm_latch(struct gps_device_t *device, struct 
timedrift_t /address@hidden@*/*td)
     device->last_fixtime.clock = td->clock.tv_sec + td->clock.tv_nsec / 1e9;
 #endif /* S_SPLINT_S */
 }
+#endif /* NTPSHM_ENABLE */
 
 /* end */
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]