mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-09-27 09:56:08 +00:00
HACKishly avoid clock_gettime() build issue with Xcode 8
This commit is contained in:
parent
a6516fc1ad
commit
300c292ec5
@ -34,7 +34,7 @@ static __attribute__((constructor)) void __init_darwin_shim(void) {
|
||||
emulator_registerStartupCallback(CTOR_PRIORITY_LATE, &_init_darwin_shim);
|
||||
}
|
||||
|
||||
int clock_gettime(int clk_id, struct timespec *tp) {
|
||||
int my_clock_gettime(int clk_id, struct timespec *tp) {
|
||||
double diff = (mach_absolute_time() - orwl_timestart) * orwl_timebase;
|
||||
tp->tv_sec = diff * ORWL_NANO;
|
||||
tp->tv_nsec = diff - (tp->tv_sec * ORWL_GIGA);
|
||||
|
@ -16,10 +16,16 @@
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#define CLOCK_MONOTONIC 1
|
||||
#define CLOCK_REALTIME 2
|
||||
#if !defined(CLOCK_MONOTONIC)
|
||||
# define CLOCK_MONOTONIC 1
|
||||
#endif
|
||||
#if !defined(CLOCK_REALTIME)
|
||||
# define CLOCK_REALTIME 2
|
||||
#endif
|
||||
|
||||
int clock_gettime(int, struct timespec *);
|
||||
#define clock_gettime my_clock_gettime
|
||||
|
||||
int my_clock_gettime(int, struct timespec *);
|
||||
|
||||
#endif // __APPLE__
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user