1 From 9ea8ded37b648bbd538cbf9c4d144b8b1a93c1b5 Mon Sep 17 00:00:00 2001
2 From: Carlos Santos <casantos@datacom.ind.br>
3 Date: Thu, 19 Jan 2017 17:27:37 -0200
4 Subject: [PATCH] build-sys: fix compilation with ncurses and uClibc or musl
7 Compiling util-linux with musl and uClibc-ng toolchains when wide-char
8 support is not enabled in ncurses results in compilation failures with
11 error: two or more data types in declaration specifiers
15 The problem occurs because util-linux #defines its own wchar_t (as char)
16 when configured without widechar support. This conflicts with definition
17 of wchar_t contained in stddef.h.
19 This error can be reproduced running "<toolchain-cc -o test test.c" with
20 the following test program:
31 The only way to avoid the problem it to reorder the inclusion of headers
32 in some files under the text-utils directory.
35 http://autobuild.buildroot.net/results/3a2f228e0fa7b5cc28a13d49f48f1a6aef8d9d7a
36 http://autobuild.buildroot.net/results/99e96069f652d511c6212a5bb6be29e68fb1747c
37 http://autobuild.buildroot.net/results/2dc5721aef93b7b410153bafad78248fac3db941
38 http://autobuild.buildroot.net/results/8a9e197ba7a292b18f8c0c36dca974685556a38a
40 Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
42 text-utils/colcrt.c | 2 +-
43 text-utils/colrm.c | 2 +-
44 text-utils/column.c | 2 +-
45 3 files changed, 3 insertions(+), 3 deletions(-)
47 diff --git a/text-utils/colcrt.c b/text-utils/colcrt.c
48 index c6bba4b..346a10f 100644
49 --- a/text-utils/colcrt.c
50 +++ b/text-utils/colcrt.c
55 -#include "widechar.h"
57 +#include "widechar.h"
58 #include "closestream.h"
61 diff --git a/text-utils/colrm.c b/text-utils/colrm.c
62 index 9510b72..d474696 100644
63 --- a/text-utils/colrm.c
64 +++ b/text-utils/colrm.c
69 -#include "widechar.h"
72 +#include "widechar.h"
73 #include "closestream.h"
76 diff --git a/text-utils/column.c b/text-utils/column.c
77 index 43b3af5..2eb47a3 100644
78 --- a/text-utils/column.c
79 +++ b/text-utils/column.c
84 -#include "widechar.h"
86 +#include "widechar.h"
89 #include "closestream.h"