summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-30 11:17:06 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-30 11:17:06 -0400
commited99be6df93be541a66602d3f1b296f6c8f9797e (patch)
tree57494bc23c77967807e6c7d2c8cee6d5765d325d
parent9ade48462250c108fd7c2605faa0644348003c6a (diff)
downloadgpsd-ed99be6df93be541a66602d3f1b296f6c8f9797e.tar.gz
Re-enable compilation with ntpshm=no.
-rw-r--r--gpsd.h-tail10
-rw-r--r--ntpshm.c3
-rw-r--r--ppsthread.c6
3 files changed, 10 insertions, 9 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 29a79a2b..a11bcac3 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -250,11 +250,11 @@ struct gps_context_t {
* 'optimize' as 'dead code' the writes to SHM */
/*@reldef@*/volatile struct shmTime *shmTime[NTPSHMSEGS];
bool shmTimeInuse[NTPSHMSEGS];
+#endif /* NTPSHM_ENABLE */
# ifdef PPS_ENABLE
/*@null@*/ void (*pps_hook)(struct gps_device_t *,
unsigned long, struct timespec *);
# endif /* PPS_ENABLE */
-#endif /* NTPSHM_ENABLE */
#ifdef SHM_EXPORT_ENABLE
/* we don't want the compiler to treat writes to shmexport as dead code,
* and we don't want them reordered either */
@@ -463,10 +463,11 @@ struct gps_device_t {
#endif /* TIMING_ENABLE */
#ifdef NTPSHM_ENABLE
int shmindex;
- timestamp_t last_fixtime; /* so updates happen once */
bool ship_to_ntpd;
-# ifdef PPS_ENABLE
+#endif /* NTPSHM_ENABLE */
+#ifdef PPS_ENABLE
int shmTimeP;
+ timestamp_t last_fixtime; /* so updates happen once */
#if defined(HAVE_SYS_TIMEPPS_H)
pps_handle_t kernelpps_handle;
#endif /* defined(HAVE_SYS_TIMEPPS_H) */
@@ -478,8 +479,7 @@ struct gps_device_t {
struct timespec *,
double);
/*@null@*/ void (*thread_wrap_hook)(struct gps_device_t *);
-# endif /* PPS_ENABLE */
-#endif /* NTPSHM_ENABLE */
+#endif /* PPS_ENABLE */
double mag_var; /* magnetic variation in degrees */
bool back_to_nmea; /* back to NMEA on revert? */
char msgbuf[MAX_PACKET_LENGTH*2+1]; /* command message buffer for sends */
diff --git a/ntpshm.c b/ntpshm.c
index 4ccea3ed..5fe96af3 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -22,6 +22,8 @@
#endif /* S_SPLINT_S */
#include "gpsd.h"
+
+#ifdef NTPSHM_ENABLE
#include <sys/time.h>
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -499,4 +501,5 @@ void ntpd_link_activate(struct gps_device_t *session)
}
}
+#endif /* NTPSHM_ENABLE */
/* end */
diff --git a/ppsthread.c b/ppsthread.c
index f7d95350..64aa021f 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -33,9 +33,7 @@
#ifdef PPS_ENABLE
#if defined(HAVE_SYS_TIMEPPS_H)
#include <fcntl.h> /* needed for open() and friends */
-#endif
-#if defined(HAVE_SYS_TIMEPPS_H)
static pthread_mutex_t initialization_mutex;
static volatile int uninitialized_pps_thread_count;
#endif /* defined(HAVE_SYS_TIMEPPS_H) */
@@ -281,7 +279,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
break;
}
TVTOTS( &ts, &tv);
-#endif
+#endif /* HAVE_CLOCK_GETTIME */
/*@+noeffect@*/
/* ok and log used by KPPS and TIOMCWAIT */
@@ -501,7 +499,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
ts = pi.clear_timestamp; /* structure copy */
}
} else
-#endif
+#endif /* defined(HAVE_SYS_TIMEPPS_H) */
{
// use plain PPS
/*@i10@*/TVTOTS( &ts, &tv);