From 38f8253d29db5a10c4bc7482ec076a5eb3f2fe1f Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Wed, 3 Nov 2021 12:55:12 -0700 Subject: [PATCH] build fix for Mac OS, Apple Silicon On MacOS, arm64 IFM_1000_TX and IFM_1000_T are the same value, causing a build failure. Signed-off-by: Lawrence D'Anna --- psutil/_psutil_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c index 7c0d548c4..0f0b6631c 100644 --- a/psutil/_psutil_posix.c +++ b/psutil/_psutil_posix.c @@ -504,13 +504,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;