Skip to content

Commit

Permalink
Merge branch 'blawrence/macos-11-fix' into 'master'
Browse files Browse the repository at this point in the history
Fix the build for macOS 11 deployment target

See merge request machine-learning/dorado!703
  • Loading branch information
blawrence-ont committed Nov 13, 2023
2 parents 07aeb89 + 32d3a14 commit 1c2a4a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dorado/utils/metal_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ std::optional<int64_t> retrieve_ioreg_prop(const std::string &service_class,
if (!matching_dict) {
return std::nullopt;
}
// Note: kIOMainPortDefault was introduced on MacOS 12. If support for earlier versions
// is needed an alternate constant will be needed.

#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000 /* MAC_OS_VERSION_12_0 */
// These are the same variable, just renamed in macOS 12+.
const mach_port_t kIOMainPortDefault = kIOMasterPortDefault;
#endif
// IOServiceGetMatchingService consumes a reference to matching_dict, so we don't need
// to release it ourselves.
io_service_t service = IOServiceGetMatchingService(kIOMainPortDefault, matching_dict);
Expand Down

0 comments on commit 1c2a4a3

Please sign in to comment.