diff options
Diffstat (limited to 'ppsthread.h')
-rw-r--r-- | ppsthread.h | 20 |
1 files changed, 10 insertions, 10 deletions
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 <time.h> + +#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 <unistd.h> #include <sys/time.h> #include <sys/timepps.h> #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 */ |