From 223480e55ed098cb5f6001f9f49e73b191586e18 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 27 Nov 2014 09:17:21 +0000 Subject: fix include position --- src/time.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/time.c b/src/time.c index 1753ad4..7beef48 100644 --- a/src/time.c +++ b/src/time.c @@ -16,6 +16,13 @@ #include #include +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) && (defined _POSIX_MONOTONIC_CLOCK) +#include +#elif defined(__riscos) +#include +#else +#include +#endif #include "nsutils/time.h" /* exported interface documented in nsutils/time.h */ @@ -25,20 +32,17 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out) static uint64_t prev = 0; /* previous time so we never go backwards */ #if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) && (defined _POSIX_MONOTONIC_CLOCK) -#include struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp); current = (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000); -#elif defined(riscos) -#include "oslib/os.h" +#elif defined(__riscos) os_t time; time = os_read_monotonic_time(); current = time * 10; #else #warning "Using dodgy gettimeofday() fallback" -#include /** \todo Implement this properly! */ struct timeval tv; -- cgit v1.2.3