clock_gettime.c: Use __APPLE__ instead of __MACH__

Hurd also defines __MACH__, but it does not have mach_absolute_time. Use
the more strict __APPLE__ instead.

Has also been sent upstream: https://github.com/libcheck/check/pull/65
This commit is contained in:
Nirbheek Chauhan 2016-11-02 14:11:43 +05:30 committed by Tim-Philipp Müller
parent 7610e50fd0
commit ca31500eb9

View file

@ -1,6 +1,6 @@
#include "libcompat.h" #include "libcompat.h"
#ifdef __MACH__ #ifdef __APPLE__
#include <mach/clock.h> #include <mach/clock.h>
#include <mach/mach.h> #include <mach/mach.h>
#include <mach/mach_time.h> #include <mach/mach_time.h>
@ -15,7 +15,7 @@ int
clock_gettime (clockid_t clk_id CK_ATTRIBUTE_UNUSED, struct timespec *ts) clock_gettime (clockid_t clk_id CK_ATTRIBUTE_UNUSED, struct timespec *ts)
{ {
#ifdef __MACH__ #ifdef __APPLE__
/* OS X does not have clock_gettime, use mach_absolute_time */ /* OS X does not have clock_gettime, use mach_absolute_time */
static mach_timebase_info_data_t sTimebaseInfo; static mach_timebase_info_data_t sTimebaseInfo;