diff mbox series

[meta-darwin,19/21] libedit: don't include glibc's stdc-predef.h on Darwin nativesdk

Message ID 20261014141209.488034-19-ecordonnier@snap.com
State New
Headers show
Series [meta-darwin,01/21] meta-darwin: bump layer series to wrynose (6.0.3) | expand

Commit Message

Etienne Cordonnier Oct. 14, 2026, 2:10 p.m. UTC
From: Etienne Cordonnier <ecordonnier@snap.com>

chartype.h includes <stdc-predef.h> unconditionally, which doesn't exist
in the macOS SDK or the Darwin GCC toolchain, so do_compile fails.
Skip the include on __APPLE__.

Tested by building nativesdk-libedit for x86_64-darwin.

AI-Generated: Claude Sonnet 5.5

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 ...don-t-include-stdc-predef.h-on-Apple.patch | 21 +++++++++++++++++++
 recipes-devtools/libedit/libedit_%.bbappend   |  5 +++++
 2 files changed, 26 insertions(+)
 create mode 100644 recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch
 create mode 100644 recipes-devtools/libedit/libedit_%.bbappend
diff mbox series

Patch

diff --git a/recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch b/recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch
new file mode 100644
index 0000000..62317a2
--- /dev/null
+++ b/recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch
@@ -0,0 +1,21 @@ 
+From: Etienne Cordonnier <ecordonnier@snap.com>
+Subject: [PATCH] chartype.h: don't include stdc-predef.h on Apple
+
+stdc-predef.h is a glibc header which doesn't exist in the macOS SDK
+or the Darwin GCC toolchain.
+
+Upstream-Status: Pending
+Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
+---
+--- a/src/chartype.h
++++ b/src/chartype.h
+@@ -29,7 +29,9 @@
+ #ifndef _h_chartype_f
+ #define _h_chartype_f
+ 
++#ifndef __APPLE__
+ #include <stdc-predef.h>
++#endif
+ /* Ideally we should also test the value of the define to see if it
+  * supports non-BMP code points without requiring UTF-16, but nothing
+  * seems to actually advertise this properly, despite Unicode 3.1 having
diff --git a/recipes-devtools/libedit/libedit_%.bbappend b/recipes-devtools/libedit/libedit_%.bbappend
new file mode 100644
index 0000000..75e63a8
--- /dev/null
+++ b/recipes-devtools/libedit/libedit_%.bbappend
@@ -0,0 +1,5 @@ 
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append:darwin21 = " \
+    file://0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch \
+"