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)

untested guess of a fix

  • src/occa/internal/utils/sys.cpp

    old new  
    2020#    include <sys/sysinfo.h>
    2121#  else // OCCA_MACOS_OS
    2222#    include <mach/mach_host.h>
    23 #    ifdef __clang__
     23#    ifdef CLOCK_UPTIME_RAW
    2424#      include <CoreServices/CoreServices.h>
    2525#      include <mach/mach_time.h>
    2626#    else
     
    8282
    8383      return (double) (ct.tv_sec + (1.0e-9 * ct.tv_nsec));
    8484#elif (OCCA_OS == OCCA_MACOS_OS)
    85 #  ifdef __clang__
     85#  ifdef CLOCK_UPTIME_RAW
    8686      uint64_t nanoseconds = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
    8787
    8888      return 1.0e-9 * nanoseconds;