package/xterm: fix compilation with uClibc
PATCH 1/1 package/xterm: fix compilation with uClibc
Compile errors out with:
./util.c: In function 'decode_wcwidth':
./util.c:5506:26: error: 'wcwidth' undeclared (first use in this function); did you mean 'mk_wcwidth'?
5506 | my_wcwidth = wcwidth;
| ^~~~~~~
| mk_wcwidth./util.c:5506:26: note: each undeclared identifier is reported only once for each function it appears in
uClibc only exposes wcwidth when __USE_XOPEN is defined.
Fixes:
- http://autobuild.buildroot.net/results/1c0/1c03a8016d480d9c3fc3112849b1a125df243cab
--- package/xterm/0001-uClibc-wcwidth.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 package/xterm/0001-uClibc-wcwidth.patch
package/xterm/0001-uClibc-wcwidth.patch new file +13 -0
@@ -0,0 +1,13 @@ +Signed-off-by: Waldemar Brodkorb <[email protected]> +Upstream: N/A patch sent via email +diff -Nur xterm-376.orig/util.c xterm-376/util.c +--- xterm-376.orig/util.c 2022-09-25 19:46:22.000000000 +0200 ++++ xterm-376/util.c 2023-09-03 09:05:36.227133537 +0200 +@@ -69,6 +69,7 @@ + + #if OPT_WIDE_CHARS + #if defined(HAVE_WCHAR_H) && defined(HAVE_WCWIDTH) ++#define __USE_XOPEN + #include <wchar.h> + #endif + #include <wcwidth.h>
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 9 lines · On Sun, 3 Sep 2023 09:51:43 +0200 Waldemar Brodkorb <[email protected]> wrote:
Compile errors out with:
./util.c: In function 'decode_wcwidth':
./util.c:5506:26: error: 'wcwidth' undeclared (first use in this function); did you mean 'mk_wcwidth'?5506 | my_wcwidth = wcwidth; | ^~~~~~~ | mk_wcwidth./util.c:5506:26: note: each undeclared identifier is reported only once for each function it appears in
uClibc only exposes wcwidth when
__USE_XOPENis defined.
According to the wcwidth manpage, it's _XOPEN_SOURCE that needs to be defined:
SYNOPSIS
#define _XOPEN_SOURCE /* See feature_test_macros(7) */
#include <wchar.h>
int wcwidth(wchar_t c);I guess __USE_XOPEN is a more "internal" thing.
package/xterm/0001-uClibc-wcwidth.patch line 2
Quoted 8 lines
package/xterm/0001-uClibc-wcwidth.patch new file +2
-0@@ -0,0 +1,13 @@ +Signed-off-by: Waldemar Brodkorb <[email protected]> +Upstream: N/A patch sent via email
Meh these upstream projects not using Git... :/
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot