This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 239be4d49c24a913e721d2e1d11804eea6a727ed
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Aug 6 11:35:38 2026 -0400

    libxslt: add missing stdlib.h include for getenv/strtol
    
    Clang defaults to C23, which errors on implicit function declarations.
    libxslt 1.1.34's extensions.c and libexslt/date.c call getenv/strtol
    without including stdlib.h, breaking the bundled build on modern
    toolchains (e.g. Xcode clang on macOS).
    
    (cherry picked from commit 96a14a438f1678e04af9c07d7e77f2ebfe03d5c9)
---
 main/libxslt/libxslt-stdlib-getenv.patch | 22 ++++++++++++++++++++++
 main/libxslt/makefile.mk                 |  3 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/main/libxslt/libxslt-stdlib-getenv.patch 
b/main/libxslt/libxslt-stdlib-getenv.patch
new file mode 100644
index 0000000000..a08f785531
--- /dev/null
+++ b/main/libxslt/libxslt-stdlib-getenv.patch
@@ -0,0 +1,22 @@
+diff -ur misc/libxslt-1.1.34/libxslt/extensions.c 
misc/build/libxslt-1.1.34/libxslt/extensions.c
+--- misc/libxslt-1.1.34/libxslt/extensions.c
++++ misc/build/libxslt-1.1.34/libxslt/extensions.c
+@@ -13,6 +13,7 @@
+ #include "libxslt.h"
+
+ #include <string.h>
++#include <stdlib.h>
+ #include <limits.h>
+
+ #include <libxml/xmlmemory.h>
+diff -ur misc/libxslt-1.1.34/libexslt/date.c 
misc/build/libxslt-1.1.34/libexslt/date.c
+--- misc/libxslt-1.1.34/libexslt/date.c
++++ misc/build/libxslt-1.1.34/libexslt/date.c
+@@ -46,6 +46,7 @@
+ #include "exslt.h"
+
+ #include <string.h>
++#include <stdlib.h>
+ #include <limits.h>
+
+ #ifdef HAVE_ERRNO_H
diff --git a/main/libxslt/makefile.mk b/main/libxslt/makefile.mk
index dbdd13a4da..bfe4b616cb 100644
--- a/main/libxslt/makefile.mk
+++ b/main/libxslt/makefile.mk
@@ -49,7 +49,8 @@ TARFILE_MD5=db8765c8d076f1b6caafd9f2542a304a
 
 # libxslt-internal-symbols: #i112480#: Solaris ld requires symbols to be 
defined
 PATCH_FILES=libxslt-configure.patch \
-            libxslt-win_manifest.patch
+            libxslt-win_manifest.patch \
+            libxslt-stdlib-getenv.patch
 
 # This is only for UNX environment now
 .IF "$(OS)"=="WNT"

Reply via email to