summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-26 18:45:28 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-26 18:45:28 +0000
commit86abb02796d5bfc0c71d46ad9923ff8737e03280 (patch)
treeec88a80c838430e7d8694e0ebe6c2ffdd44b0cf2
parent6e872682bccee956e13e018651be551bb89647de (diff)
* 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
-rw-r--r--libc/ChangeLog.eglibc5
-rw-r--r--libc/argp/argp-fmtstream.c8
-rw-r--r--libc/argp/argp-help.c2
3 files changed, 15 insertions, 0 deletions
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 <joseph@codesourcery.com>
+
+ * argp/argp-fmtstream.c, argp/argp-help.c: Condition uses of
+ libc-internal interfaces on _LIBC.
+
2011-10-25 Michael Hope <michael.hope@linaro.org>
* 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)