about summary refs log tree commit diff
path: root/argp/argp-help.c
diff options
context:
space:
mode:
authorCharles-Antoine Couret <charles-antoine.couret@essensium.com>2018-11-29 17:56:55 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-11-29 17:56:55 +0000
commit3a67e81d7527363a96af095a5af03b6201b82e9d (patch)
treed9bf1888085845dba749047c639977b4ce28f8b8 /argp/argp-help.c
parent4975f0c3d0131fdf697be0b1631c265e5fd39088 (diff)
downloadglibc-3a67e81d7527363a96af095a5af03b6201b82e9d.tar.gz
glibc-3a67e81d7527363a96af095a5af03b6201b82e9d.tar.xz
glibc-3a67e81d7527363a96af095a5af03b6201b82e9d.zip
argp: do not call _IO_fwide() if _LIBC is not defined
_IO_fwide() is defined in libio.h file. This file is included only
when _LIBC is defined.

So, in case of compilation of these files without _LIBC definition,
the compilation failed due to this unknown function.

Now this function is called when libio.h file is included.

(Change merged from gnulib.  Tested on x86_64.)

	* argp/argp-fmtstream.c (__argp_fmtstream_update): Use [_LIBC]
	conditional on calls to _IO_fwide and putwc_unlocked.  (Merge from
	gnulib.)
	* argp/argp-help.c (__argp_failure): Likewise.
Diffstat (limited to 'argp/argp-help.c')
-rw-r--r--argp/argp-help.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/argp/argp-help.c b/argp/argp-help.c
index 2b6b0775d6..a17260378c 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -1873,9 +1873,11 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
 #endif
 	    }
 
+#ifdef _LIBC
 	  if (_IO_fwide (stream, 0) > 0)
 	    putwc_unlocked (L'\n', stream);
 	  else
+#endif
 	    putc_unlocked ('\n', stream);
 
 #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)