From: Carlos Santos Date: Thu, 19 Jan 2017 19:27:37 +0000 (-0200) Subject: build-sys: fix compilation with ncurses and uClibc or musl libc X-Git-Tag: v2.29.1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3163efbab67a7ec44da1ed1c8153e4ab99e19947;p=thirdparty%2Futil-linux.git build-sys: fix compilation with ncurses and uClibc or musl libc Compiling util-linux with musl and uClibc-ng toolchains when wide-char support is not enabled in ncurses results in compilation failures with the following message: error: two or more data types in declaration specifiers #define wchar_t char The problem occurs because util-linux #defines its own wchar_t (as char) when configured without widechar support. This conflicts with definition of wchar_t contained in stddef.h. This error can be reproduced running " #define wchar_t char #include int main() { return 0; } The only way to avoid the problem it to reorder the inclusion of headers in some files under the text-utils directory. Addresses: http://autobuild.buildroot.net/results/3a2f228e0fa7b5cc28a13d49f48f1a6aef8d9d7a http://autobuild.buildroot.net/results/99e96069f652d511c6212a5bb6be29e68fb1747c http://autobuild.buildroot.net/results/2dc5721aef93b7b410153bafad78248fac3db941 http://autobuild.buildroot.net/results/8a9e197ba7a292b18f8c0c36dca974685556a38a Signed-off-by: Carlos Santos --- diff --git a/text-utils/colcrt.c b/text-utils/colcrt.c index 62f84251a0..f37635093e 100644 --- a/text-utils/colcrt.c +++ b/text-utils/colcrt.c @@ -46,8 +46,8 @@ #include #include "nls.h" -#include "widechar.h" #include "c.h" +#include "widechar.h" #include "closestream.h" /* diff --git a/text-utils/colrm.c b/text-utils/colrm.c index 431eae0d2f..e799cd10f4 100644 --- a/text-utils/colrm.c +++ b/text-utils/colrm.c @@ -44,9 +44,9 @@ #include #include "nls.h" -#include "widechar.h" #include "strutils.h" #include "c.h" +#include "widechar.h" #include "closestream.h" /* diff --git a/text-utils/column.c b/text-utils/column.c index b8d31c989a..e0144a2df3 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -50,8 +50,8 @@ #include #include "nls.h" -#include "widechar.h" #include "c.h" +#include "widechar.h" #include "xalloc.h" #include "strutils.h" #include "closestream.h"