build: various fixes for compiling on macOS

This commit is contained in:
Christian Hergert
2020-11-16 14:01:02 -08:00
parent c82b0a1677
commit f18fbe5ae8
7 changed files with 48 additions and 8 deletions

View File

@ -80,7 +80,11 @@ sysprof_clock_get_current_time (void)
SysprofClock clock = sysprof_clock;
if SYSPROF_UNLIKELY (clock == -1)
#ifdef __APPLE__
clock = _CLOCK_MONOTONIC;
#else
clock = CLOCK_MONOTONIC;
#endif
clock_gettime (clock, &ts);
return (ts.tv_sec * SYSPROF_NSEC_PER_SEC) + ts.tv_nsec;