]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: fix missing prototype for `get_wch`
authorPatrick Steinhardt <ps@pks.im>
Tue, 10 Apr 2018 12:36:31 +0000 (13:36 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Jul 2018 14:04:38 +0000 (16:04 +0200)
The header <ncursesw/ncurses.h> defines the get_wch(3) function only
when `NCURSES_WIDECHAR` is defined. This define is actually getting set
in the same header file, but only in case `_XOPEN_SOURCE` is defined and
has a value of 500 or higher. As we already have the precedence of
defining `_XOPEN_SOURCE` to a value of 600 in some other files, simply
define it to the minimum required value of 500 in "cfdisk.c". This
silences a warning for `get_wch` being unknown.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
disk-utils/cfdisk.c

index 221e72716ae823f4e40361df33b31c77e826b523..13c8a62dfbe2802a20838833bc4790797c993762 100644 (file)
 # include <slang/slang.h>
 #endif
 
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 500 /* for inclusion of get_wch */
+#endif
+
 #ifdef HAVE_SLCURSES_H
 # include <slcurses.h>
 #elif defined(HAVE_SLANG_SLCURSES_H)