From 6910a0e8cd985a521269cfc5b9d8f2f83618ffd2 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 11 Aug 2026 15:58:24 +0800 Subject: [PATCH] libuv: Restore support for macOS 10.5 and 10.6 Upstream libuv no longer supports these versions. Follow up commit abac34eda2 (libuv: Restore support for macOS 10.x, 2026-03-05, v4.4.0-rc1~571^2~3). This leaves out macOS 10.4, since a) it needs a lot more invasive changes, b) neither MacPorts nor my PPCPorts support 10.4 anymore. Signed-off-by: Sergey Fedorov --- Utilities/cmlibuv/src/unix/udp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c index 029f27f7a9..20dc85fc3f 100644 --- a/Utilities/cmlibuv/src/unix/udp.c +++ b/Utilities/cmlibuv/src/unix/udp.c @@ -194,7 +194,8 @@ void uv__udp_io(uv_loop_t* loop, uv__io_t* w, unsigned int revents) { } static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf, int flag) { -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) +#if defined(__linux__) || defined(__FreeBSD__) || \ + (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) struct sockaddr_in6 peers[20]; struct iovec iov[ARRAY_SIZE(peers)]; struct mmsghdr msgs[ARRAY_SIZE(peers)]; @@ -844,6 +845,7 @@ static int uv__udp_set_membership6(uv_udp_t* handle, !defined(__NetBSD__) && \ !defined(__ANDROID__) && \ !defined(__DragonFly__) && \ + (!defined(__APPLE__) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)) && \ !defined(__GNU__) && \ !defined(QNX_IOPKT) static int uv__udp_set_source_membership4(uv_udp_t* handle, @@ -968,7 +970,8 @@ int uv__udp_init_ex(uv_loop_t* loop, int uv_udp_using_recvmmsg(const uv_udp_t* handle) { -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) +#if defined(__linux__) || defined(__FreeBSD__) || \ + (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) if (handle->flags & UV_HANDLE_UDP_RECVMMSG) return 1; #endif @@ -1056,7 +1059,8 @@ int uv_udp_set_source_membership(uv_udp_t* handle, !defined(__NetBSD__) && \ !defined(__ANDROID__) && \ !defined(__DragonFly__) && \ - !defined(__GNU__) && \ + (!defined(__APPLE__) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)) && \ + !defined(__GNU__) && \ !defined(QNX_IOPKT) int err; union uv__sockaddr mcast_addr; @@ -1410,7 +1414,8 @@ static int uv__udp_sendmsgv(int fd, r = 0; nsent = 0; -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ +#if defined(__linux__) || defined(__FreeBSD__) || \ + (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) || \ (defined(__sun__) && defined(MSG_WAITFORONE)) || defined(__QNX__) if (count > 1) { for (i = 0; i < count; /*empty*/) {