Skip to content

Commit ba98c8e

Browse files
committed
Legacy SDKs may call main master (e.g., iPhoneOS6.1).
1 parent 29725db commit ba98c8e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ if test "$my_htop_platform" = darwin; then
225225
AC_CHECK_TYPES([thread_extended_info_data_t], [], [], [[#include <mach/thread_info.h>]])
226226
AC_CHECK_MEMBERS([struct vm_statistics64.compressor_page_count], [], [], [[#include <mach/mach_host.h>]])
227227
AC_CHECK_MEMBERS([struct vm_statistics64.external_page_count], [], [], [[#include <mach/mach_host.h>]])
228+
229+
AC_CHECK_DECLS([kIOMainPortDefault], [], [], [[#include <IOKit/IOKitLib.h>]])
228230
fi
229231

230232
# ----------------------------------------------------------------------

darwin/DarwinMachine.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ in the source distribution for its full text.
1616
#include <unistd.h>
1717
#include <sys/mman.h>
1818
#include <sys/sysctl.h>
19+
#include <Availability.h>
1920

2021
#include "CRT.h"
2122
#include "Machine.h"
@@ -24,6 +25,10 @@ in the source distribution for its full text.
2425
#include "generic/openzfs_sysctl.h"
2526
#include "zfs/ZfsArcStats.h"
2627

28+
// Compatibility for older SDKs.
29+
#if defined(HAVE_DECL_KIOMAINPORTDEFAULT) && !HAVE_DECL_KIOMAINPORTDEFAULT
30+
#define kIOMainPortDefault kIOMasterPortDefault
31+
#endif
2732

2833
static void DarwinMachine_getHostInfo(host_basic_info_data_t* p) {
2934
mach_msg_type_number_t info_size = HOST_BASIC_INFO_COUNT;

0 commit comments

Comments
 (0)