2016-10-26 22:27:38 +00:00
|
|
|
#pragma once
|
|
|
|
/** Allows to build on MacOS X
|
|
|
|
*
|
|
|
|
* Highly experimental, not recommended, disabled by default.
|
|
|
|
*
|
|
|
|
* To use, include this file with -include compiler parameter.
|
|
|
|
*/
|
|
|
|
|
2017-02-07 21:26:32 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
2017-01-18 23:28:23 +00:00
|
|
|
#include <common/config_common.h>
|
2016-11-02 09:29:39 +00:00
|
|
|
|
|
|
|
#if APPLE_SIERRA_OR_NEWER == 0
|
2016-10-26 22:27:38 +00:00
|
|
|
/**
|
|
|
|
* MacOS X doesn't support different clock sources
|
|
|
|
*
|
|
|
|
* Mapping all of them to 0, except for
|
|
|
|
* CLOCK_THREAD_CPUTIME_ID, because there is a way
|
|
|
|
* to implement it using in-kernel stats about threads
|
|
|
|
*/
|
|
|
|
#define CLOCK_MONOTONIC_COARSE 0
|
|
|
|
#define CLOCK_REALTIME 0
|
|
|
|
#define CLOCK_MONOTONIC 0
|
|
|
|
#define CLOCK_THREAD_CPUTIME_ID 3
|
|
|
|
|
|
|
|
typedef int clockid_t;
|
|
|
|
int clock_gettime(int clk_id, struct timespec* t);
|
2016-11-02 09:29:39 +00:00
|
|
|
#else
|
|
|
|
#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
|
|
|
|
#endif
|
2017-02-07 21:26:32 +00:00
|
|
|
|
|
|
|
#endif
|