Skip to content

Commit

Permalink
build fix for Mac OS, Apple Silicon (#2010)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
smoofra committed Oct 20, 2022
1 parent 8e58bce commit b0f780a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion psutil/_psutil_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b0f780a

Please sign in to comment.