>From 8208c314448c4a26beda29b9666a5626521b7312 Mon Sep 17 00:00:00 2001 From: Bruno Haible
Date: Sun, 5 Jan 2020 12:23:00 +0100 Subject: [PATCH 1/2] mbstoc32s: New module. * lib/uchar.in.h (mbstoc32s): New declaration. * lib/mbstoc32s.c: New file. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSTOC32S. * modules/uchar (Makefile.am): Substitute GNULIB_MBSTOC32S. * modules/mbstoc32s: New file. * tests/test-uchar-c++.cc: Test the signature of mbstoc32s. * doc/posix-functions/mbstowcs.texi: Mention the new module. --- ChangeLog | 11 +++++++++++ doc/posix-functions/mbstowcs.texi | 7 +++++-- lib/mbstoc32s.c | 33 +++++++++++++++++++++++++++++++++ lib/uchar.in.h | 11 +++++++++++ m4/uchar.m4 | 3 ++- modules/mbstoc32s | 28 ++++++++++++++++++++++++++++ modules/uchar | 1 + tests/test-uchar-c++.cc | 5 +++++ 8 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 lib/mbstoc32s.c create mode 100644 modules/mbstoc32s diff --git a/ChangeLog b/ChangeLog index 1a1d8b9..f2d507b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2020-01-05 Bruno Haible + mbstoc32s: New module. + * lib/uchar.in.h (mbstoc32s): New declaration. + * lib/mbstoc32s.c: New file. + * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSTOC32S. + * modules/uchar (Makefile.am): Substitute GNULIB_MBSTOC32S. + * modules/mbstoc32s: New file. + * tests/test-uchar-c++.cc: Test the signature of mbstoc32s. + * doc/posix-functions/mbstowcs.texi: Mention the new module. + +2020-01-05 Bruno Haible + Tweak recently added tests. * tests/test-mbrtoc32.c: Make signature consistent with uchar.in.h. * tests/test-mbsrtoc32s.c: Likewise. diff --git a/doc/posix-functions/mbstowcs.texi b/doc/posix-functions/mbstowcs.texi index af6ea73..5d7dc4c 100644 --- a/doc/posix-functions/mbstowcs.texi +++ b/doc/posix-functions/mbstowcs.texi @@ -13,6 +13,9 @@ Portability problems fixed by Gnulib: Portability problems not fixed by Gnulib: @itemize @item -On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot -accommodate all Unicode characters. +On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and +therefore cannot accommodate all Unicode characters. +However, the Gnulib function @code{mbstoc32s}, provided by Gnulib module +@code{mbstoc32s}, operates on 32-bit wide characters and therefore does not +have this limitation. @end itemize diff --git a/lib/mbstoc32s.c b/lib/mbstoc32s.c new file mode 100644 index 0000000..ede2786 --- /dev/null +++ b/lib/mbstoc32s.c @@ -0,0 +1,33 @@ +/* Convert string to 32-bit wide string. + Copyright (C) 2020 Free Software Foundation, Inc. + Written by Bruno Haible , 2020. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see