Open jakirkham opened 10 months ago
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
kIOMainPortDefault
kIOMasterPortDefault
https://github.com/giampaolo/psutil/blob/27a1432daeacd46b287517c11bfea2af4fd95a88/psutil/arch/osx/cpu.c#L140
Given that both of these constants are equal to NULL, one approach would be to use NULL instead
NULL
cc @snOm3ad (who may have authored this code and have thoughts on the approach here)
xref: https://github.com/giampaolo/psutil/pull/2222
Summary
Description
On macOS pre-12.0
kIOMainPortDefault
is undefined. Instead it is calledkIOMasterPortDefault
. As a result, when building on macOS pre-12.0 with the constantkIOMainPortDefault
(as seen below), an error is generatedhttps://github.com/giampaolo/psutil/blob/27a1432daeacd46b287517c11bfea2af4fd95a88/psutil/arch/osx/cpu.c#L140
Given that both of these constants are equal to
NULL
, one approach would be to useNULL
insteadcc @snOm3ad (who may have authored this code and have thoughts on the approach here)
xref: https://github.com/giampaolo/psutil/pull/2222