[MacPorts] #67259: libocca fails to build with Clang on < 10.12: clock_get_time, mach_port_deallocate

MacPorts noreply at macports.org
Mon Apr 17 22:00:24 UTC 2023


#67259: libocca fails to build with Clang on < 10.12: clock_get_time,
mach_port_deallocate
---------------------------+--------------------------
  Reporter:  barracuda156  |      Owner:  barracuda156
      Type:  defect        |     Status:  assigned
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.8.1
Resolution:                |   Keywords:
      Port:  libocca       |
---------------------------+--------------------------

Comment (by ryandesign):

 `clock_gettime` is a standard cross-platform function that made its first
 appearance on macOS in version 10.12. legacysupport provides an
 implementation of it for 10.11 and earlier systems. But this port isn't
 including legacysupport in order to get `clock_gettime`; it's including it
 to get `getline`.

 `clock_get_time` on the other hand is a macOS (Mach kernel) function
 available since version 10.0:
 https://developer.apple.com/documentation/kernel/1420035-clock_get_time

 `mach_port_deallocate` is too:
 https://developer.apple.com/documentation/kernel/1578777-mach_port_deallocate

 If the build says these functions are undeclared, the fix might simply be
 to include the header where they're declared, which is <mach/mach_port.h>.
 However I see there is also a <mach/mach.h> which includes mach_port.h
 among other things; maybe it is preferred to include mach.h.

 I see that occa already does include Mach headers in
 src/occa/internal/utils/sys.cpp, and around there I see another instance
 if `#ifdef __clang__` that might need the same fix as the one already
 being applied further down in the file by 0003-Check-for-CLOCK_UPTIME_RAW-
 on-macOS-before-using-it.patch.

-- 
Ticket URL: <https://trac.macports.org/ticket/67259#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list