From 2e4a91e8dac81838a2a35e7aed5a74c3ec098e0e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 31 Mar 2015 00:38:23 -0400 Subject: ppsthread.[ch] and timespec_str.c are now fully detached from the rest of GPSD. This means they could be dropped into NTP or another time-service program. The only requirement is to set -DHAVE_SYS_TIMEPPS_H if you want the RFC2783 code compiled in. --- ppsthread.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ppsthread.h') diff --git a/ppsthread.h b/ppsthread.h index 3d4aece7..ae9c824c 100644 --- a/ppsthread.h +++ b/ppsthread.h @@ -6,6 +6,16 @@ #ifndef PPSTHREAD_H #define PPSTHREAD_H +#include + +#ifndef TIMEDELTA_DEFINED +#define TIMEDELTA_DEFINED +struct timedelta_t { + struct timespec real; + struct timespec clock; +}; +#endif /* TIMEDELTA_DEFINED */ + /* use RFC 2782 PPS API */ /* this needs linux >= 2.6.34 and * CONFIG_PPS=y @@ -15,20 +25,10 @@ #if defined(HAVE_SYS_TIMEPPS_H) // include unistd.h here as it is missing on older pps-tools releases. // 'close' is not defined otherwise. -#include #include #include #endif -#ifndef TIMEDELTA_DEFINED -#define TIMEDELTA_DEFINED -struct timedelta_t { - struct timespec real; - struct timespec clock; -}; -#endif /* TIMEDELTA_DEFINED */ - - /* difference between timespecs in nanoseconds */ /* int is too small, avoid floats */ /* WARNING! this will overflow if x and y differ by more than a few seconds */ -- cgit v1.2.1