The name of the IORegistry port property is not consistent across macOS versions: it's port on some, usb-port-number on others. (Run ioreg -c AppleUSB30HubPort or ioreg -c AppleUSB20HubPort to show the properties on your Mac.)
get_device_port in os/darwin_usb.c should pass kUSBHostPortPropertyPortNumber rather than "port" to get_ioregistry_value_data. This makes libusb_get_port_numbers return port numbers on all recent versions of macOS.
The name of the IORegistry port property is not consistent across macOS versions: it's
porton some,usb-port-numberon others. (Runioreg -c AppleUSB30HubPortorioreg -c AppleUSB20HubPortto show the properties on your Mac.)get_device_portin os/darwin_usb.c should passkUSBHostPortPropertyPortNumberrather than"port"toget_ioregistry_value_data. This makeslibusb_get_port_numbersreturn port numbers on all recent versions of macOS.