]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix compilation with ncurses and uClibc or musl libc
authorCarlos Santos <casantos@datacom.ind.br>
Thu, 19 Jan 2017 19:27:37 +0000 (17:27 -0200)
committerKarel Zak <kzak@redhat.com>
Fri, 20 Jan 2017 10:07:46 +0000 (11:07 +0100)
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 "<toolchain-cc -o test test.c" with
the following test program:

    #include <ctype.h>
    #define wchar_t char
    #include <stddef.h>

    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 <casantos@datacom.ind.br>
text-utils/colcrt.c
text-utils/colrm.c
text-utils/column.c

index c6bba4b50f399a54c2533e74d8838ce7310795b0..346a10fff74f6f3f81473fcf640897df3bb89383 100644 (file)
@@ -46,8 +46,8 @@
 #include <getopt.h>
 
 #include "nls.h"
-#include "widechar.h"
 #include "c.h"
+#include "widechar.h"
 #include "closestream.h"
 
 /*
index 9510b7296300a85eca7350ebb62e7b76f39dfe5a..d474696e7d67029c3b0a85df638a3cb98b9025b7 100644 (file)
@@ -44,9 +44,9 @@
 #include <unistd.h>
 
 #include "nls.h"
-#include "widechar.h"
 #include "strutils.h"
 #include "c.h"
+#include "widechar.h"
 #include "closestream.h"
 
 /*
index 43b3af5f5aeb2b9396ef461243a180586105647f..2eb47a3ea7e77646ad32a923feefb9f94f8f9ae3 100644 (file)
@@ -50,8 +50,8 @@
 #include <getopt.h>
 
 #include "nls.h"
-#include "widechar.h"
 #include "c.h"
+#include "widechar.h"
 #include "xalloc.h"
 #include "strutils.h"
 #include "closestream.h"