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 @@ #define ORWL_GIGA UINT64_C(1000000000) int -clock_gettime(int clock_id, struct timespec *tp) +clock_gettime(clockid_t clock_id, struct timespec *tp) { static double orwl_timebase = 0.0; 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 @@ * sys/time.h compatibility shim */ +#ifndef LIBCRYPTOCOMPAT_TIME_H +#define LIBCRYPTOCOMPAT_TIME_H + #ifdef _MSC_VER #if _MSC_VER >= 1900 #include <../ucrt/time.h> @@ -31,7 +34,8 @@ time_t timegm(struct tm *tm); #endif #ifndef HAVE_CLOCK_GETTIME -int clock_gettime(int clock_id, struct timespec *tp); +typedef int clockid_t; +int clock_gettime(clockid_t clock_id, struct timespec *tp); #endif #ifndef timespecsub @@ -45,3 +49,5 @@ int clock_gettime(int clock_id, struct timespec *tp); } \ } while (0) #endif + +#endif