Skip to content

Commit

Permalink
build fix for Mac OS, Apple Silicon
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.
  • Loading branch information
smoofra committed Nov 3, 2021
1 parent 0e15b48 commit 5aeb505
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 @@ -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;
Expand Down

0 comments on commit 5aeb505

Please sign in to comment.