diff options
Diffstat (limited to 'src/lib/clock_gettime.h')
-rw-r--r-- | src/lib/clock_gettime.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/clock_gettime.h b/src/lib/clock_gettime.h index ac4ca1f85..6a8dd57ff 100644 --- a/src/lib/clock_gettime.h +++ b/src/lib/clock_gettime.h @@ -30,13 +30,34 @@ /* otherwise, we have to define it */ +#ifdef __WIN32__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct timespec { + uint64_t tv_sec; + int32_t tv_nsec; +};/* struct timespec */ + +#ifdef __cplusplus +}/* extern "C" */ +#endif /* __cplusplus */ + +#else /* ! __WIN32__ */ + /* get timespec from <time.h> */ #include <time.h> +#endif /* __WIN32__ */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +struct timespec; + typedef enum { CLOCK_REALTIME, CLOCK_MONOTONIC, @@ -44,7 +65,7 @@ typedef enum { CLOCK_MONOTONIC_HR } clockid_t; -long clock_gettime(clockid_t which_clock, struct timespec *tp); +long clock_gettime(clockid_t which_clock, struct timespec* tp); #ifdef __cplusplus }/* extern "C" */ @@ -52,4 +73,3 @@ long clock_gettime(clockid_t which_clock, struct timespec *tp); #endif /* HAVE_CLOCK_GETTIME */ #endif /*__CVC4__LIB__CLOCK_GETTIME_H */ - |