Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] error: use of undeclared identifier 'kIOMainPortDefault' #2354

Open
jakirkham opened this issue Jan 20, 2024 · 0 comments
Open

[macOS] error: use of undeclared identifier 'kIOMainPortDefault' #2354

jakirkham opened this issue Jan 20, 2024 · 0 comments

Comments

@jakirkham
Copy link

jakirkham commented Jan 20, 2024

Summary

  • OS: macOS
  • Architecture: x86_64 or aarch64
  • Psutil version: 5.9.8 (did not happen in 5.9.7)
  • Python version: 3.8-3.12
  • Type: installation (build)

Description

On macOS pre-12.0 kIOMainPortDefault is undefined. Instead it is called kIOMasterPortDefault. As a result, when building on macOS pre-12.0 with the constant kIOMainPortDefault (as seen below), an error is generated

status = IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iter);

Given that both of these constants are equal to NULL, one approach would be to use NULL instead

cc @snOm3ad (who may have authored this code and have thoughts on the approach here)

xref: #2222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant