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 <xlocale.h>" 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 <dcbw@libreoffice.org>
This commit is contained in:
Dan Williams
2026-09-30 23:41:32 +02:00
parent 8dcca1011d
commit dabd91337a
2 changed files with 24 additions and 0 deletions
+1
View File
@@ -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)
+23
View File
@@ -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 <unistd.h>
#endif
+#if defined(HAVE_XLOCALE_H) || defined(__APPLE__)
+#include <xlocale.h>
+#endif
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcprivate.h>
--- 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_XLOCALE_H
+#if defined(HAVE_XLOCALE_H) || defined(__APPLE__)
#include <xlocale.h>
#endif