From 86abb02796d5bfc0c71d46ad9923ff8737e03280 Mon Sep 17 00:00:00 2001 From: joseph Date: Wed, 26 Oct 2011 18:45:28 +0000 Subject: * argp/argp-fmtstream.c, argp/argp-help.c: Condition uses of libc-internal interfaces on _LIBC. git-svn-id: svn://svn.eglibc.org/trunk@15586 7b3dc134-2b1b-0410-93df-9e9f96275f8d --- libc/ChangeLog.eglibc | 5 +++++ libc/argp/argp-fmtstream.c | 8 ++++++++ libc/argp/argp-help.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc index c09d24f3d..a7c914cd8 100644 --- a/libc/ChangeLog.eglibc +++ b/libc/ChangeLog.eglibc @@ -1,3 +1,8 @@ +2011-10-26 Joseph Myers + + * argp/argp-fmtstream.c, argp/argp-help.c: Condition uses of + libc-internal interfaces on _LIBC. + 2011-10-25 Michael Hope * aclocal.m4 (PKGVERSION_TEXI): Define. diff --git a/libc/argp/argp-fmtstream.c b/libc/argp/argp-fmtstream.c index 22bfc4ea7..d13d20923 100644 --- a/libc/argp/argp-fmtstream.c +++ b/libc/argp/argp-fmtstream.c @@ -102,7 +102,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs) __argp_fmtstream_update (fs); if (fs->p > fs->buf) { +#ifdef _LIBC __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); +#else + fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); +#endif } free (fs->buf); free (fs); @@ -147,6 +151,7 @@ __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) { #if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO @@ -156,6 +161,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) #endif } else +#endif putc_unlocked (' ', fs->stream); } } @@ -316,6 +322,7 @@ __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) { #ifdef OPTION_POSIX_WIDE_CHAR_DEVICE_IO @@ -325,6 +332,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) #endif } else +#endif putc_unlocked (' ', fs->stream); /* Copy the tail of the original buffer into the current buffer diff --git a/libc/argp/argp-help.c b/libc/argp/argp-help.c index 7004a2e54..9747395e8 100644 --- a/libc/argp/argp-help.c +++ b/libc/argp/argp-help.c @@ -1874,6 +1874,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum, #endif } +#ifdef _LIBC if (_IO_fwide (stream, 0) > 0) { #if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO @@ -1883,6 +1884,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum, #endif } else +#endif putc_unlocked ('\n', stream); #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) -- cgit v1.2.3