]> sourceware.org Git - glibc.git/commitdiff
argp: do not call _IO_fwide() if _LIBC is not defined
authorCharles-Antoine Couret <charles-antoine.couret@essensium.com>
Thu, 29 Nov 2018 17:56:55 +0000 (17:56 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 29 Nov 2018 17:56:55 +0000 (17:56 +0000)
_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.

ChangeLog
argp/argp-fmtstream.c
argp/argp-help.c

index 7eaee6de41fa48d93466fb9257a309502f94cfbb..1551dc0ec3440fdc596fb48ded77c3865d82ffda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-11-29  Charles-Antoine Couret  <charles-antoine.couret@essensium.com>
+
+       * 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.
+
 2018-11-29  Mao Han  <han_mao@c-sky.com>
 
        * elf/elf.h (EM_CSKY, R_CKCORE_NONE, R_CKCORE_ADDR32)
index e43a0c7cf135654d840ae50c4ffd20f07bfaa400..e9e4c0e5cca326e805df1ac01f3ca2c569030f39 100644 (file)
@@ -149,9 +149,11 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
              size_t i;
              for (i = 0; i < pad; i++)
                {
+#ifdef _LIBC
                  if (_IO_fwide (fs->stream, 0) > 0)
                    putwc_unlocked (L' ', fs->stream);
                  else
+#endif
                    putc_unlocked (' ', fs->stream);
                }
            }
@@ -312,9 +314,11 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
              *nl++ = ' ';
          else
            for (i = 0; i < fs->wmargin; ++i)
+#ifdef _LIBC
              if (_IO_fwide (fs->stream, 0) > 0)
                putwc_unlocked (L' ', fs->stream);
              else
+#endif
                putc_unlocked (' ', fs->stream);
 
          /* Copy the tail of the original buffer into the current buffer
index 2b6b0775d65451d183e3c9c4613767da624fec33..a17260378cd67106254ebb5be9f6034ce6485087 100644 (file)
@@ -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)
This page took 0.698573 seconds and 5 git commands to generate.