Ticket #67259: 0003-Check-for-CLOCK_UPTIME_RAW-on-macOS-before-using-it.patch
File 0003-Check-for-CLOCK_UPTIME_RAW-on-macOS-before-using-it.patch, 669 bytes (added by ryandesign (Ryan Carsten Schmidt), 18 months ago) |
---|
-
src/occa/internal/utils/sys.cpp
old new 20 20 # include <sys/sysinfo.h> 21 21 # else // OCCA_MACOS_OS 22 22 # include <mach/mach_host.h> 23 # ifdef __clang__23 # ifdef CLOCK_UPTIME_RAW 24 24 # include <CoreServices/CoreServices.h> 25 25 # include <mach/mach_time.h> 26 26 # else … … 82 82 83 83 return (double) (ct.tv_sec + (1.0e-9 * ct.tv_nsec)); 84 84 #elif (OCCA_OS == OCCA_MACOS_OS) 85 # ifdef __clang__85 # ifdef CLOCK_UPTIME_RAW 86 86 uint64_t nanoseconds = clock_gettime_nsec_np(CLOCK_UPTIME_RAW); 87 87 88 88 return 1.0e-9 * nanoseconds;