Do clock_gettime() weak symbol check only on OS X/iOS
This commit is contained in:
@@ -68,8 +68,12 @@ void freeze_timestamp( void )
|
|||||||
// adjusted after system sleep
|
// adjusted after system sleep
|
||||||
struct timespec tp;
|
struct timespec tp;
|
||||||
|
|
||||||
|
if (
|
||||||
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
// Check for presence, for OS X SDK >= 10.12 and runtime < 10.12
|
// Check for presence, for OS X SDK >= 10.12 and runtime < 10.12
|
||||||
if ( &clock_gettime != NULL && clock_gettime( CLOCK_MONOTONIC, &tp ) == 0 ) {
|
&clock_gettime != NULL &&
|
||||||
|
#endif
|
||||||
|
clock_gettime( CLOCK_MONOTONIC, &tp ) == 0 ) {
|
||||||
uint64_t millis = tp.tv_nsec / 1000000;
|
uint64_t millis = tp.tv_nsec / 1000000;
|
||||||
millis += uint64_t( tp.tv_sec ) * 1000;
|
millis += uint64_t( tp.tv_sec ) * 1000;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user