diff options
author | Brent Cook <busterb@gmail.com> | 2018-03-23 13:45:05 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2018-03-23 13:45:05 -0500 |
commit | 6b513a1c78b8a8c4c48b9ef476628728974f3171 (patch) | |
tree | 7da788236665e3f408c65ac05d9278202213ff82 | |
parent | 4b2a8cd1c16896ca5d4570656435aa1b69bcbd46 (diff) | |
download | portable-6b513a1c78b8a8c4c48b9ef476628728974f3171.tar.gz portable-6b513a1c78b8a8c4c48b9ef476628728974f3171.tar.bz2 portable-6b513a1c78b8a8c4c48b9ef476628728974f3171.zip |
add proper guard and typedef
-rw-r--r-- | apps/openssl/compat/clock_gettime_osx.c | 2 | ||||
-rw-r--r-- | include/compat/time.h | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/openssl/compat/clock_gettime_osx.c b/apps/openssl/compat/clock_gettime_osx.c index bb385e4..5545187 100644 --- a/apps/openssl/compat/clock_gettime_osx.c +++ b/apps/openssl/compat/clock_gettime_osx.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #define ORWL_GIGA UINT64_C(1000000000) | 5 | #define ORWL_GIGA UINT64_C(1000000000) |
6 | 6 | ||
7 | int | 7 | int |
8 | clock_gettime(int clock_id, struct timespec *tp) | 8 | clock_gettime(clockid_t clock_id, struct timespec *tp) |
9 | { | 9 | { |
10 | static double orwl_timebase = 0.0; | 10 | static double orwl_timebase = 0.0; |
11 | static uint64_t orwl_timestart = 0; | 11 | static uint64_t orwl_timestart = 0; |
diff --git a/include/compat/time.h b/include/compat/time.h index fb0ab29..8f08c9a 100644 --- a/include/compat/time.h +++ b/include/compat/time.h | |||
@@ -3,6 +3,9 @@ | |||
3 | * sys/time.h compatibility shim | 3 | * sys/time.h compatibility shim |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef LIBCRYPTOCOMPAT_TIME_H | ||
7 | #define LIBCRYPTOCOMPAT_TIME_H | ||
8 | |||
6 | #ifdef _MSC_VER | 9 | #ifdef _MSC_VER |
7 | #if _MSC_VER >= 1900 | 10 | #if _MSC_VER >= 1900 |
8 | #include <../ucrt/time.h> | 11 | #include <../ucrt/time.h> |
@@ -31,7 +34,8 @@ time_t timegm(struct tm *tm); | |||
31 | #endif | 34 | #endif |
32 | 35 | ||
33 | #ifndef HAVE_CLOCK_GETTIME | 36 | #ifndef HAVE_CLOCK_GETTIME |
34 | int clock_gettime(int clock_id, struct timespec *tp); | 37 | typedef int clockid_t; |
38 | int clock_gettime(clockid_t clock_id, struct timespec *tp); | ||
35 | #endif | 39 | #endif |
36 | 40 | ||
37 | #ifndef timespecsub | 41 | #ifndef timespecsub |
@@ -45,3 +49,5 @@ int clock_gettime(int clock_id, struct timespec *tp); | |||
45 | } \ | 49 | } \ |
46 | } while (0) | 50 | } while (0) |
47 | #endif | 51 | #endif |
52 | |||
53 | #endif | ||