diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/compat/sys/time.h | 4 | ||||
-rw-r--r-- | include/compat/time.h | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/include/compat/sys/time.h b/include/compat/sys/time.h index 3d31985..76428c1 100644 --- a/include/compat/sys/time.h +++ b/include/compat/sys/time.h | |||
@@ -13,10 +13,6 @@ int gettimeofday(struct timeval *tp, void *tzp); | |||
13 | #include_next <sys/time.h> | 13 | #include_next <sys/time.h> |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #ifndef CLOCK_MONOTONIC | ||
17 | #define CLOCK_MONOTONIC CLOCK_REALTIME | ||
18 | #endif | ||
19 | |||
20 | #ifndef timersub | 16 | #ifndef timersub |
21 | #define timersub(tvp, uvp, vvp) \ | 17 | #define timersub(tvp, uvp, vvp) \ |
22 | do { \ | 18 | do { \ |
diff --git a/include/compat/time.h b/include/compat/time.h index df65530..dc460ef 100644 --- a/include/compat/time.h +++ b/include/compat/time.h | |||
@@ -13,6 +13,9 @@ | |||
13 | #include_next <time.h> | 13 | #include_next <time.h> |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #ifndef LIBCRYPTOCOMPAT_TIME_H | ||
17 | #define LIBCRYPTOCOMPAT_TIME_H | ||
18 | |||
16 | #ifdef _WIN32 | 19 | #ifdef _WIN32 |
17 | struct tm *__gmtime_r(const time_t * t, struct tm * tm); | 20 | struct tm *__gmtime_r(const time_t * t, struct tm * tm); |
18 | #define gmtime_r(tp, tm) __gmtime_r(tp, tm) | 21 | #define gmtime_r(tp, tm) __gmtime_r(tp, tm) |
@@ -22,6 +25,19 @@ struct tm *__gmtime_r(const time_t * t, struct tm * tm); | |||
22 | time_t timegm(struct tm *tm); | 25 | time_t timegm(struct tm *tm); |
23 | #endif | 26 | #endif |
24 | 27 | ||
28 | #ifndef CLOCK_MONOTONIC | ||
29 | #define CLOCK_MONOTONIC CLOCK_REALTIME | ||
30 | #endif | ||
31 | |||
32 | #ifndef CLOCK_REALTIME | ||
33 | #define CLOCK_REALTIME 0 | ||
34 | #endif | ||
35 | |||
36 | #ifndef HAVE_CLOCK_GETTIME | ||
37 | typedef int clockid_t; | ||
38 | int clock_gettime(clockid_t clock_id, struct timespec *tp); | ||
39 | #endif | ||
40 | |||
25 | #ifndef timespecsub | 41 | #ifndef timespecsub |
26 | #define timespecsub(tsp, usp, vsp) \ | 42 | #define timespecsub(tsp, usp, vsp) \ |
27 | do { \ | 43 | do { \ |
@@ -33,3 +49,5 @@ time_t timegm(struct tm *tm); | |||
33 | } \ | 49 | } \ |
34 | } while (0) | 50 | } while (0) |
35 | #endif | 51 | #endif |
52 | |||
53 | #endif | ||