Opened 3 years ago

Closed 3 years ago

#56156 closed defect (fixed)

libusb @1.0.22: build fails on 10.7.5: error: use of undeclared identifier 'kUSBDeviceSpeedSuper'

Reported by: kencu (Ken) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch lion Cc: tobypeterson, ryandesign (Ryan Schmidt)
Port: libusb

Description

'kUSBDeviceSpeedSuper' is supposed to be available on 10.7+ <https://developer.apple.com/documentation/iokit/1425357-usbdevicespeed/kusbdevicespeedsuper> but apparently actually is not:

os/darwin_usb.c:1043:10: error: use of undeclared identifier 'kUSBDeviceSpeedSuper'; did you mean 'kUSBDeviceSpeedFull'?
    case kUSBDeviceSpeedSuper: dev->speed = LIBUSB_SPEED_SUPER; break;
         ^~~~~~~~~~~~~~~~~~~~
         kUSBDeviceSpeedFull
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:899:9: note: 'kUSBDeviceSpeedFull' declared here
        kUSBDeviceSpeedFull             = 1,
        ^
os/darwin_usb.c:1043:10: error: duplicate case value 'kUSBDeviceSpeedFull'
    case kUSBDeviceSpeedSuper: dev->speed = LIBUSB_SPEED_SUPER; break;
         ^
os/darwin_usb.c:1040:10: note: previous case defined here
    case kUSBDeviceSpeedFull: dev->speed = LIBUSB_SPEED_FULL; break;
         ^
2 errors generated.

simple patch allows it to build.

Attachments (1)

patch-libusb-10.7-nospeedsuper.diff (667 bytes) - added by kencu (Ken) 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by kencu (Ken)

comment:1 Changed 3 years ago by kencu (Ken)

$ port -v installed libusb
The following ports are currently installed:
  libusb @1.0.21_0 platform='darwin 11' archs='x86_64' date='2018-03-14T16:33:25-0700'
  libusb @1.0.22_0 (active) platform='darwin 11' archs='x86_64' date='2018-03-26T20:21:19-0700'

comment:2 Changed 3 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign added
Keywords: lion added
Summary: libusb@1.0.22: build fails on 10.7.5 : error: use of undeclared identifier 'kUSBDeviceSpeedSuper'libusb @1.0.22: build fails on 10.7.5: error: use of undeclared identifier 'kUSBDeviceSpeedSuper'

I already reported the problem to the developers: https://github.com/libusb/libusb/issues/410

The correct patch is to change #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 to #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080.

comment:3 Changed 3 years ago by kencu (Ken)

shall we patch this in the repo, then? It'll be a while before a new version of libuv rolls out with this fixed.

comment:4 Changed 3 years ago by ryandesign (Ryan Schmidt)

Yes.

comment:6 Changed 3 years ago by ken-cunningham-webuse

Resolution: fixed
Status: newclosed

In 98c6bfc28f2914021a68c1bc23f63ec50a1245ab/macports-ports:

libusb* : fix build on 10.7.5

closes: #56156

Note: See TracTickets for help on using tickets.