From 4992d10e9b9ad614d005b1943580cc8ead89691a Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 7 Aug 2026 03:17:25 +0000 Subject: [PATCH 26/38] host (Apple): guard IOPlatformExpertDevice lookup behind 10.5 check IOServiceGetMatchingService()/IOServiceMatching() for this service aren't usable before macOS 10.5; skip on older targets. Ported from https://github.com/macos-powerpc/powerpc-ports/blob/main/sysutils/fastfetch/files/0012-Misc-fixes-for-legacy-systems.patch --- src/detection/host/host_apple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/host/host_apple.c b/src/detection/host/host_apple.c index a855ba5a4..4ed02d5b3 100644 --- a/src/detection/host/host_apple.c +++ b/src/detection/host/host_apple.c @@ -3,6 +3,7 @@ #include "common/apple/cf_helpers.h" #include +#include const char* getProductNameWithIokit(FFstrbuf* result) { FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t registryEntry = IORegistryEntryFromPath(MACH_PORT_NULL, "IODeviceTree:/product"); @@ -19,6 +20,7 @@ const char* getProductNameWithIokit(FFstrbuf* result) { } const char* getOthersByIokit(FFHostResult* host) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t registryEntry = IOServiceGetMatchingService(MACH_PORT_NULL, IOServiceMatching("IOPlatformExpertDevice")); if (!registryEntry) { return "IOServiceGetMatchingService() failed"; @@ -43,7 +45,7 @@ const char* getOthersByIokit(FFHostResult* host) { if (version) { ffCfStrGetString(version, &host->version); } - +#endif return nullptr; } -- 2.43.0