add proper guard and typedef

This commit is contained in:
Brent Cook
2018-03-23 13:45:05 -05:00
parent 4b2a8cd1c1
commit 6b513a1c78
2 changed files with 8 additions and 2 deletions

View File

@@ -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