Skip to content

Commit

Permalink
m1cpu: handle kIOMainPortDefault for macOS < 12 (#6)
Browse files Browse the repository at this point in the history
`kIOMainPortDefault` was renamed from `kIOMasterPortDefault` in macOS
Monterey. This patch makes sure m1cpu can be built on Big Sur, too.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
  • Loading branch information
ZhongRuoyu committed Apr 4, 2023
1 parent d0606a0 commit 32788e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
package m1cpu

// #cgo LDFLAGS: -framework CoreFoundation -framework IOKit
// #include <AvailabilityMacros.h>
// #include <CoreFoundation/CoreFoundation.h>
// #include <IOKit/IOKitLib.h>
// #include <sys/sysctl.h>
//
// #ifndef MAC_OS_VERSION_12_0
// #define kIOMainPortDefault kIOMasterPortDefault
// #endif
//
// #define HzToGHz(hz) ((hz) / 1000000000.0)
//
// UInt64 global_pCoreHz;
Expand Down

0 comments on commit 32788e5

Please sign in to comment.