ntdll: On macOS, don't use clock_gettime() even if it's available.
The problem is building against the 10.12 or later SDK but deploying to 10.11 or earlier. Support for clock_gettime() is new with 10.12 so configure finds it and the code uses it, but the symbol is weak linked and resolves to NULL when running on earlier versions. Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ebeefff87f
commit
27c71e09ad
|
@ -101,7 +101,12 @@ static ULONGLONG monotonic_counter(void)
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
|
|
||||||
#ifdef HAVE_CLOCK_GETTIME
|
#ifdef __APPLE__
|
||||||
|
static mach_timebase_info_data_t timebase;
|
||||||
|
|
||||||
|
if (!timebase.denom) mach_timebase_info( &timebase );
|
||||||
|
return mach_absolute_time() * timebase.numer / timebase.denom / 100;
|
||||||
|
#elif defined(HAVE_CLOCK_GETTIME)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
#ifdef CLOCK_MONOTONIC_RAW
|
#ifdef CLOCK_MONOTONIC_RAW
|
||||||
if (!clock_gettime( CLOCK_MONOTONIC_RAW, &ts ))
|
if (!clock_gettime( CLOCK_MONOTONIC_RAW, &ts ))
|
||||||
|
@ -109,11 +114,6 @@ static ULONGLONG monotonic_counter(void)
|
||||||
#endif
|
#endif
|
||||||
if (!clock_gettime( CLOCK_MONOTONIC, &ts ))
|
if (!clock_gettime( CLOCK_MONOTONIC, &ts ))
|
||||||
return ts.tv_sec * (ULONGLONG)TICKSPERSEC + ts.tv_nsec / 100;
|
return ts.tv_sec * (ULONGLONG)TICKSPERSEC + ts.tv_nsec / 100;
|
||||||
#elif defined(__APPLE__)
|
|
||||||
static mach_timebase_info_data_t timebase;
|
|
||||||
|
|
||||||
if (!timebase.denom) mach_timebase_info( &timebase );
|
|
||||||
return mach_absolute_time() * timebase.numer / timebase.denom / 100;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gettimeofday( &now, 0 );
|
gettimeofday( &now, 0 );
|
||||||
|
|
Loading…
Reference in New Issue