From e5bf94941d278ba6355f7dc114ea7f0af8e53de5 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 27 Jul 2026 10:54:48 +0000 Subject: [PATCH 2/2] build: expose Darwin locale_t/newlocale/uselocale/freelocale This project's meson.build unconditionally passes -D_GNU_SOURCE=200809L, which is a glibc-only macro Darwin ignores entirely, so locale_t/newlocale/uselocale/freelocale (used for the COLR table version parsing) are left undeclared by on macOS. Defining _DARWIN_C_SOURCE keeps __DARWIN_C_LEVEL at full visibility, which is what actually gates these declarations. Also include explicitly, since older SDKs are reported to require it directly rather than getting it transitively via . Must happen before any system header is pulled in transitively, hence this comes before even fcft/fcft.h. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01U6fuL1PtRJHhr97gAGyS1h --- fcft.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fcft.c b/fcft.c index 4cea2d4..16ec270 100644 --- a/subprojects/fcft/fcft.c +++ b/subprojects/fcft/fcft.c @@ -1,3 +1,24 @@ +#if defined(__APPLE__) + /* + * Without _DARWIN_C_SOURCE (or another visibility macro implying + * full __DARWIN_C_LEVEL), hides locale_t/newlocale/ + * uselocale/freelocale on some SDKs. This project's meson.build + * already passes -D_GNU_SOURCE=200809L unconditionally, which is a + * glibc-only macro Darwin ignores entirely, so it doesn't help here. + * Must be defined before any system header is pulled in + * transitively, hence this comes before even fcft/fcft.h. + */ + #ifndef _DARWIN_C_SOURCE + #define _DARWIN_C_SOURCE + #endif + /* + * Some older SDKs (pre-10.15-ish) additionally require this header + * to be included explicitly for the same symbols, rather than being + * pulled in automatically by . + */ + #include +#endif + #include "fcft/fcft.h" #include