From dabd91337a44b9c3792bb0985624c4980023225a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 30 Sep 2026 11:18:19 -0500 Subject: [PATCH] fontconfig: include xlocale.h for locale_t on old macOS Sonoma (macOS 14) builds with Xcode 15.2 can't find locale_t when building fontconfig. Later OS versions and Xcode builds don't seem to have that problem. In file included from fcarch.c:24: ./fcint.h:682:9: error: unknown type name 'locale_t' typedef locale_t FcLocale; ^ Fontconfig added "#include " recently in c24472116 to fix the issue, but also switched to the Meson build system which is the only mechanism by which HAVE_XLOCALE_H gets defined. Given that LibreOffice uses fontconfig's old configure-based system and it's a bunch of work to switch to meson here, we're not going to bump fontconfig just for this. For now just assume all Apple platforms have xlocale.h, which they do. Change-Id: Ida9ef328dbd79e0c54b3d37355c344d7ca8d1b4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211630 Tested-by: Jenkins Reviewed-by: Dan Williams --- .../fontconfig/UnpackedTarball_fontconfig.mk | 1 + external/fontconfig/apple-xlocale.patch.1 | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 external/fontconfig/apple-xlocale.patch.1 diff --git a/external/fontconfig/UnpackedTarball_fontconfig.mk b/external/fontconfig/UnpackedTarball_fontconfig.mk index a43a3db7f840..fdc476da3937 100644 --- a/external/fontconfig/UnpackedTarball_fontconfig.mk +++ b/external/fontconfig/UnpackedTarball_fontconfig.mk @@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,fontconfig,0)) $(eval $(call gb_UnpackedTarball_add_patches,fontconfig,\ external/fontconfig/fontconfig-2.12.1.patch.1 \ external/fontconfig/nowarnnoconfig.patch.1 \ + external/fontconfig/apple-xlocale.patch.1 \ )) ifneq ($(OS),MACOSX) diff --git a/external/fontconfig/apple-xlocale.patch.1 b/external/fontconfig/apple-xlocale.patch.1 new file mode 100644 index 000000000000..af5744cb9326 --- /dev/null +++ b/external/fontconfig/apple-xlocale.patch.1 @@ -0,0 +1,23 @@ +--- fontconfig/src/fcint.h.foo 2026-09-30 11:01:43 ++++ fontconfig/src/fcint.h 2026-09-30 11:10:23 +@@ -44,6 +44,9 @@ + #ifdef HAVE_UNISTD_H + # include + #endif ++#if defined(HAVE_XLOCALE_H) || defined(__APPLE__) ++#include ++#endif + #include + #include + +--- fontconfig/src/fcstr.c.foo 2026-09-30 11:05:33 ++++ fontconfig/src/fcstr.c 2026-09-30 11:10:17 +@@ -28,7 +28,7 @@ + #include + #include + #include +-#ifdef HAVE_XLOCALE_H ++#if defined(HAVE_XLOCALE_H) || defined(__APPLE__) + #include + #endif +