Fix for libusb_get_port_numbers on macOS 26+#1700
Closed
mvp wants to merge 1 commit intolibusb:masterfrom
Closed
Conversation
Youw
approved these changes
Sep 16, 2025
Member
Youw
left a comment
There was a problem hiding this comment.
The changes looks good, but I do not have macOS 26 yet to verify.
seanm
requested changes
Sep 16, 2025
Contributor
seanm
left a comment
There was a problem hiding this comment.
Your commit message is great, has lots of good info. But some of that info needs to be in the code as a comment.
|
I also found some anomalies under macos26, but I am not sure if it is caused by the same problem. |
macOS 26 has changed port number property name: ``` % diff -u /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBHostFamilyDefinitions.h /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBHostFamilyDefinitions.h ... -#define kUSBHostPortPropertyPortNumber "port" +#define kUSBHostPortPropertyPortNumber "usb-port-number" ... ``` Unfortunately, we cannot just use constant `kUSBHostPortPropertyPortNumber` in libusb code because it would mean that the same binary that works on macOS 15 will not work on macOS 26. Solution is to use appropriate string for port number property depending on running OS version.
5e39e09 to
b6b65b5
Compare
Contributor
Author
Added comments, and also signed my commit (had to force push). |
seanm
approved these changes
Sep 16, 2025
Contributor
Author
Member
|
I am upgrading my Mac Mini M1 to macOS 26 now. Just upgraded to 15.7. This is the result of under 15.7. |
Member
|
Just upgraded to macOS 26 and now I can reproduce the issue. And this PR is good. |
mcuee
approved these changes
Sep 18, 2025
Member
|
I think you can merge this PR. Thanks. |
sonatique
reviewed
Sep 18, 2025
sonatique
approved these changes
Sep 18, 2025
Chris-AC9KH
pushed a commit
to JS8Call-improved/libusb
that referenced
this pull request
Feb 21, 2026
macOS 26 has changed port number property name: ``` % diff -u /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/System/Library/ Frameworks/IOKit.framework/Headers/usb/IOUSBHostFamilyDefinitions.h /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/System/Library/ Frameworks/IOKit.framework/Headers/usb/IOUSBHostFamilyDefinitions.h ... -#define kUSBHostPortPropertyPortNumber "port" +#define kUSBHostPortPropertyPortNumber "usb-port-number" ... ``` Unfortunately, we cannot just use constant `kUSBHostPortPropertyPortNumber` in libusb code because it would mean that the same binary that works on macOS 15 will not work on macOS 26. Solution is to use appropriate string for port number property depending on running OS version. Closes libusb#1700 References libusb#1661
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
macOS 26 has changed port number property name:
Unfortunately, we cannot just use constant
kUSBHostPortPropertyPortNumberin libusb code because it would mean that the same binary that works on macOS 15 will not work on macOS 26.Solution is to use appropriate string for port number property depending on running OS version.