diff options
author | Bruno Haible <bruno@clisp.org> | 2010-01-01 03:04:02 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-01-01 03:04:02 +0100 |
commit | 79055a21a68c1ed45ac68ee193fa65827a6d419c (patch) | |
tree | 87ced62a6413bdbc0540cf326ca17c4b839a9e5c | |
parent | 079077222e944a3991c1b72f21e9e2fc0dcba428 (diff) | |
download | external_gettext-79055a21a68c1ed45ac68ee193fa65827a6d419c.zip external_gettext-79055a21a68c1ed45ac68ee193fa65827a6d419c.tar.gz external_gettext-79055a21a68c1ed45ac68ee193fa65827a6d419c.tar.bz2 |
Avoid passing an 'rpl_mbstate_t *' to the system's wcrtomb.
-rw-r--r-- | gettext-runtime/intl/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-runtime/intl/vasnprintf.c | 22 | ||||
-rw-r--r-- | gettext-runtime/libasprintf/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-runtime/libasprintf/vasnprintf.c | 22 |
4 files changed, 32 insertions, 22 deletions
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 654b16c..ab35972 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,8 @@ +2010-01-01 Bruno Haible <bruno@clisp.org> + + * vasnprintf.c (VASNPRINTF): If GNULIB_defined_mbstate_t is defined, + use wctomb instead of wcrtomb. + 2009-12-26 Bruno Haible <bruno@clisp.org> * libintl.rc: Update. diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index 08949b4..295dbc4 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2009 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -2368,7 +2368,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Use only as many wide characters as needed to produce at most PRECISION bytes, from the left. */ -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2382,7 +2382,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg_end == 0) /* Found the terminating null wide character. */ break; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg_end, &state); # else count = wctomb (cbuf, *arg_end); @@ -2413,7 +2413,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Use the entire string, and count the number of bytes. */ -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2427,7 +2427,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg_end == 0) /* Found the terminating null wide character. */ break; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg_end, &state); # else count = wctomb (cbuf, *arg_end); @@ -2465,7 +2465,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { TCHAR_T *tmpptr = tmpsrc; size_t remaining; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2476,7 +2476,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg == 0) abort (); -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg, &state); # else count = wctomb (cbuf, *arg); @@ -2546,7 +2546,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* We know the number of bytes in advance. */ size_t remaining; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2558,7 +2558,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg == 0) abort (); -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg, &state); # else count = wctomb (cbuf, *arg); @@ -2576,7 +2576,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else { -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2587,7 +2587,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg == 0) abort (); -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg, &state); # else count = wctomb (cbuf, *arg); diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog index 1bd01bc..79761d2 100644 --- a/gettext-runtime/libasprintf/ChangeLog +++ b/gettext-runtime/libasprintf/ChangeLog @@ -1,3 +1,8 @@ +2010-01-01 Bruno Haible <bruno@clisp.org> + + * vasnprintf.c (VASNPRINTF): If GNULIB_defined_mbstate_t is defined, + use wctomb instead of wcrtomb. + 2009-12-12 Bruno Haible <bruno@clisp.org> * *.h, *.c: Untabify. diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c index 08949b4..295dbc4 100644 --- a/gettext-runtime/libasprintf/vasnprintf.c +++ b/gettext-runtime/libasprintf/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2009 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -2368,7 +2368,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Use only as many wide characters as needed to produce at most PRECISION bytes, from the left. */ -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2382,7 +2382,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg_end == 0) /* Found the terminating null wide character. */ break; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg_end, &state); # else count = wctomb (cbuf, *arg_end); @@ -2413,7 +2413,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* Use the entire string, and count the number of bytes. */ -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2427,7 +2427,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg_end == 0) /* Found the terminating null wide character. */ break; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg_end, &state); # else count = wctomb (cbuf, *arg_end); @@ -2465,7 +2465,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { TCHAR_T *tmpptr = tmpsrc; size_t remaining; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2476,7 +2476,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg == 0) abort (); -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg, &state); # else count = wctomb (cbuf, *arg); @@ -2546,7 +2546,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { /* We know the number of bytes in advance. */ size_t remaining; -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2558,7 +2558,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg == 0) abort (); -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg, &state); # else count = wctomb (cbuf, *arg); @@ -2576,7 +2576,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else { -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); # endif @@ -2587,7 +2587,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (*arg == 0) abort (); -# if HAVE_WCRTOMB +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t count = wcrtomb (cbuf, *arg, &state); # else count = wctomb (cbuf, *arg); |