diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-08 09:53:31 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-08 09:53:31 -0400 |
commit | c492d91075cbb10c13b2670a8d63e0dae1014ec4 (patch) | |
tree | 55412f862680b4699282879891a8fbe77342666a /ppsthread.h | |
parent | c82fe00247bd9fcbf5a70901c3b022e8ddd5ab0f (diff) | |
download | gpsd-c492d91075cbb10c13b2670a8d63e0dae1014ec4.tar.gz |
Hide a macro that doesn't need to be exposed.
Diffstat (limited to 'ppsthread.h')
-rw-r--r-- | ppsthread.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ppsthread.h b/ppsthread.h index 73c8720b..4178813b 100644 --- a/ppsthread.h +++ b/ppsthread.h @@ -22,6 +22,20 @@ #endif #endif /* S_SPLINT_S */ +#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 */ +#define timespec_diff_ns(x, y) (long)(((x).tv_sec-(y).tv_sec)*1000000000+(x).tv_nsec-(y).tv_nsec) + struct pps_thread_t { struct timespec fixin_real; /* in-band time of the fix */ struct timespec fixin_clock; /* system clock time when fix received */ |