1 From 8e081f1bd5c82b842ee317cd55e70f646ae31f05 Mon Sep 17 00:00:00 2001
2 From: Simon Dawson <spdawson@gmail.com>
3 Date: Mon, 25 Aug 2014 10:26:11 +0100
4 Subject: [PATCH] Fix build error when ntpshm is false
5 To: gpsd-dev@nongnu.org
7 The build fails as follows
9 libgpsd_core.c: In function 'ntpshm_latch':
10 libgpsd_core.c:1660:24: error: 'const struct gps_type_t' has no member named 'time_offset'
11 || device->device_type->time_offset == NULL)
13 libgpsd_core.c:1663:33: error: 'const struct gps_type_t' has no member named 'time_offset'
14 fix_time += device->device_type->time_offset(device);
16 scons: *** [libgpsd_core.os] Error 1
18 The solution is to wrap #ifdef NTPSHM_ENABLE around the ntpshm_latch function
20 Signed-off-by: Simon Dawson <spdawson@gmail.com>
22 diff -Nurp a/libgpsd_core.c b/libgpsd_core.c
23 --- a/libgpsd_core.c 2014-08-22 21:33:55.000000000 +0100
24 +++ b/libgpsd_core.c 2014-09-03 18:48:34.184931741 +0100
25 @@ -1642,6 +1642,7 @@ void gpsd_zero_satellites( /*@out@*/ str
30 void ntpshm_latch(struct gps_device_t *device, struct timedrift_t /*@out@*/*td)
31 /* latch the fact that we've saved a fix */
33 @@ -1672,5 +1673,6 @@ void ntpshm_latch(struct gps_device_t *d
34 device->last_fixtime.clock = td->clock.tv_sec + td->clock.tv_nsec / 1e9;
35 #endif /* S_SPLINT_S */
37 +#endif /* NTPSHM_ENABLE */