From f777e3a5ac5d2fda9047dc2b7939d3f60bdef609 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 23 Apr 2004 21:44:22 +0000 Subject: 2004-04-23 Artem B. Bityuckiy * configure.in: Define _MB_CAPABLE if mb supported. * configure: Regenerated. * configure.host: Remove manual setting of MB_CAPABLE compiler flag. * newlib.hin: Add _MB_CAPABLE flag. * libc/ctype/iswalpha.c, libc/ctype/iswblank.c: Include and check for _MB_CAPABLE flag instead of MB_CAPABLE. * libc/ctype/iswcntrl.c, libc/ctype/iswprint.c: Ditto. * libc/ctype/iswpunct.c, libc/ctype/iswspace.c: Ditto. * libc/ctype/jp2uc.c: Ditto. * libc/ctype/towlower.c, libc/ctype/towupper.c: Ditto. * libc/locale/locale.c: Ditto * libc/machine/powerpc/vfscanf.c: Ditto * libc/stdio/vfprintf.c, libc/stdio/vfscanf.c: Ditto * libc/stdlib/mblen.c: Ditto * libc/stdlib/mblen_r.c, libc/stdlib/mbrlen.c: Ditto * libc/stdlib/mbrtowc.c, libc/stdlib/mbsrtowcs.c: Ditto * libc/stdlib/mbstowcs.c, libc/stdlib/mbtowc.c: Ditto * libc/stdlib/mbtowc_r.c, libc/stdlib/wcrtomb.c: Ditto * libc/stdlib/wcsrtombs.c, libc/stdlib/wcstombs.c: Ditto * libc/stdlib/wctomb.c, libc/sys/linux/intl/dcigettext.c: Ditto * libc/sys/linux/intl/explodename.c: Ditto * libc/sys/linux/intl/finddomain.c: Ditto * libc/sys/linux/intl/l10nflist.c: Ditto * libc/sys/linux/intl/loadmsgcat.c: Ditto * libc/sys/linux/intl/localealias.c: Ditto --- newlib/libc/stdio/vfprintf.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'newlib/libc/stdio/vfprintf.c') diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index b61c78d2c..ab40b2f6c 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -180,6 +180,7 @@ static char *rcsid = "$Id$"; #endif #include <_ansi.h> +#include #include #include #include @@ -440,7 +441,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), struct __siov iov[NIOV];/* ... and individual io vectors */ char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ char ox[2]; /* space for 0x hex-prefix */ -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE wchar_t wc; mbstate_t state; /* mbtowc calls from library must not change state */ #endif @@ -457,7 +458,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), static _CONST char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE memset (&state, '\0', sizeof (state)); #endif /* @@ -560,7 +561,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), */ for (;;) { cp = fmt; -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE while ((n = _mbtowc_r (data, &wc, fmt, MB_CUR_MAX, &state)) > 0) { if (wc == '%') break; @@ -574,7 +575,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), PRINT (cp, m); ret += m; } -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE if (n <= 0) goto done; #else @@ -1491,7 +1492,7 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), int pos, last_arg; int max_pos_arg = n; enum types { INT, LONG_INT, SHORT_INT, QUAD_INT, CHAR, CHAR_PTR, DOUBLE, LONG_DOUBLE, WIDE_CHAR }; -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE wchar_t wc; mbstate_t wc_state; int nbytes; @@ -1501,7 +1502,7 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), if (*last_fmt != NULL) fmt = *last_fmt; -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE memset (&wc_state, '\0', sizeof (wc_state)); #endif @@ -1509,7 +1510,7 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), read the desired parameter from the vararg list. */ while (*fmt && n >= numargs) { -#ifdef MB_CAPABLE +#ifdef _MB_CAPABLE while ((nbytes = _mbtowc_r (data, &wc, fmt, MB_CUR_MAX, &wc_state)) > 0) { fmt += nbytes; -- cgit v1.2.3