diff options
author | Lawrence D'Anna <larry@elder-gods.org> | 2022-10-20 19:29:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 01:29:01 +0200 |
commit | b0f780a1f46775e7d18a5176c839dac1a0977191 (patch) | |
tree | 5a143ea98bd2389a4a2773e7c1d5019508b3674a | |
parent | 8e58bce0409db7415b963fc394e93a2a4c68d61c (diff) | |
download | psutil-b0f780a1f46775e7d18a5176c839dac1a0977191.tar.gz |
build fix for Mac OS, Apple Silicon (#2010)
On MacOS, arm64 IFM_1000_TX and IFM_1000_T are the same value, causing
a build failure.
Signed-off-by: Lawrence D'Anna <larry@elder-gods.org>
-rw-r--r-- | psutil/_psutil_posix.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c index 07c10398..24628afc 100644 --- a/psutil/_psutil_posix.c +++ b/psutil/_psutil_posix.c @@ -708,13 +708,14 @@ int psutil_get_nic_speed(int ifm_active) { case(IFM_1000_LX): // 1000baseLX - single-mode fiber case(IFM_1000_CX): // 1000baseCX - 150ohm STP #if defined(IFM_1000_TX) && !defined(PSUTIL_OPENBSD) + #define HAS_CASE_IFM_1000_TX 1 // FreeBSD 4 and others (but NOT OpenBSD) -> #define IFM_1000_T in net/if_media.h case(IFM_1000_TX): #endif #ifdef IFM_1000_FX case(IFM_1000_FX): #endif -#ifdef IFM_1000_T +#if defined(IFM_1000_T) && (!HAS_CASE_IFM_1000_TX || IFM_1000_T != IFM_1000_TX) case(IFM_1000_T): #endif return 1000; |