add proper guard and typedef
This commit is contained in:
parent
4b2a8cd1c1
commit
6b513a1c78
@ -5,7 +5,7 @@
|
|||||||
#define ORWL_GIGA UINT64_C(1000000000)
|
#define ORWL_GIGA UINT64_C(1000000000)
|
||||||
|
|
||||||
int
|
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 double orwl_timebase = 0.0;
|
||||||
static uint64_t orwl_timestart = 0;
|
static uint64_t orwl_timestart = 0;
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
* sys/time.h compatibility shim
|
* sys/time.h compatibility shim
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef LIBCRYPTOCOMPAT_TIME_H
|
||||||
|
#define LIBCRYPTOCOMPAT_TIME_H
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#if _MSC_VER >= 1900
|
#if _MSC_VER >= 1900
|
||||||
#include <../ucrt/time.h>
|
#include <../ucrt/time.h>
|
||||||
@ -31,7 +34,8 @@ time_t timegm(struct tm *tm);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_CLOCK_GETTIME
|
#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
|
#endif
|
||||||
|
|
||||||
#ifndef timespecsub
|
#ifndef timespecsub
|
||||||
@ -45,3 +49,5 @@ int clock_gettime(int clock_id, struct timespec *tp);
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user