From 91452961c0af4f1f3efa920e3d831014aca80fa9 Mon Sep 17 00:00:00 2001 From: Abhas Tandon Date: Mon, 7 Sep 2026 08:55:13 +0530 Subject: [PATCH] Build against SDKs older than macOS 26 Two symbols used unconditionally are unavailable on SDKs earlier than macOS 26, so the build fails on a current macOS 15 toolchain. h3_ffmpeg.c uses SSIZE_MAX without including . It resolves only incidentally on newer SDKs; under -std=c11 on the macOS 15 SDK it is undeclared. Include the header that defines it. h3_metal.m reads MTLGPUFamilyMetal4, which the macOS 15 SDK does not declare. The existing `if (@available(macOS 26.0, *))` guard is a runtime check and cannot hide a symbol the headers never define, so compilation fails before the guard can help. Gate the block on the SDK version as well. h3_metal_probe already memsets the whole struct, so info->metal4 stays 0 when the block is compiled out, matching what the runtime guard produces on a pre-Metal 4 device. Behaviour is unchanged when building against the macOS 26 SDK. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NixTm9kQ7hojQo8nWUQGpS --- h3_ffmpeg.c | 1 + h3_metal.m | 2 ++ 2 files changed, 3 insertions(+) diff --git a/h3_ffmpeg.c b/h3_ffmpeg.c index 66762425..b051cf18 100644 --- a/h3_ffmpeg.c +++ b/h3_ffmpeg.c @@ -1,6 +1,7 @@ #include "h3_ffmpeg.h" #include +#include #include #include #include diff --git a/h3_metal.m b/h3_metal.m index 85e1d4c4..ea0de6bc 100644 --- a/h3_metal.m +++ b/h3_metal.m @@ -39,9 +39,11 @@ int h3_metal_probe(h3_device_info *info, char *error, size_t error_size) { break; } } +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 260000 if (@available(macOS 26.0, *)) { info->metal4 = [device supportsFamily:MTLGPUFamilyMetal4] ? 1 : 0; } +#endif } return 1; }