From 29fe4ac247642d158af9f1b669d06e540630f6ab Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 27 Dec 2024 23:41:52 +0100 Subject: [PATCH] Rename module uchar-c23 to uchar-h-c23. * modules/uchar-h-c23: Renamed from modules/uchar-c23. * lib/uchar.in.h: Update. * doc/posix-headers/uchar.texi: Update. * doc/posix-functions/mbrtoc32.texi: Update. * doc/strings.texi: Update. * modules/* (Depends-on): Update. * modules/uchar-c23: New file. --- ChangeLog | 11 ++++++ doc/posix-functions/mbrtoc32.texi | 4 +-- doc/posix-headers/uchar.texi | 8 ++--- doc/strings.texi | 6 ++-- lib/uchar.in.h | 2 +- modules/dfa | 4 +-- modules/mbrtoc16 | 2 +- modules/uchar-c23 | 43 ++++------------------- modules/uchar-h-c23 | 58 +++++++++++++++++++++++++++++++ 9 files changed, 89 insertions(+), 49 deletions(-) create mode 100644 modules/uchar-h-c23 diff --git a/ChangeLog b/ChangeLog index 15a235c764..bd47146e5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-12-27 Bruno Haible + + Rename module uchar-c23 to uchar-h-c23. + * modules/uchar-h-c23: Renamed from modules/uchar-c23. + * lib/uchar.in.h: Update. + * doc/posix-headers/uchar.texi: Update. + * doc/posix-functions/mbrtoc32.texi: Update. + * doc/strings.texi: Update. + * modules/* (Depends-on): Update. + * modules/uchar-c23: New file. + 2024-12-27 Bruno Haible Rename module uchar to uchar-h. diff --git a/doc/posix-functions/mbrtoc32.texi b/doc/posix-functions/mbrtoc32.texi index f95e256271..7048bffa07 100644 --- a/doc/posix-functions/mbrtoc32.texi +++ b/doc/posix-functions/mbrtoc32.texi @@ -71,7 +71,7 @@ This function is only defined as an inline function on some platforms: Haiku 2020. @end itemize -@mindex uchar-c23 +@mindex uchar-h-c23 Note: If you want the guarantee that the @code{char32_t} values returned by this function are Unicode code points, you also need to request the -@code{uchar-c23} module. +@code{uchar-h-c23} module. diff --git a/doc/posix-headers/uchar.texi b/doc/posix-headers/uchar.texi index 9abb4bc65d..e72a49b2fc 100644 --- a/doc/posix-headers/uchar.texi +++ b/doc/posix-headers/uchar.texi @@ -9,11 +9,11 @@ Defines the types @code{char16_t}, @code{char32_t} and declares the functions @code{mbrtoc16}, @code{c16rtomb}, @code{mbrtoc32}, @code{c32rtomb}. -Gnulib module: uchar-h or uchar-c23 +Gnulib module: uchar-h or uchar-h-c23 @mindex uchar-h -@mindex uchar-c23 +@mindex uchar-h-c23 -Portability problems fixed by either Gnulib module @code{uchar-h} or @code{uchar-c23}: +Portability problems fixed by either Gnulib module @code{uchar-h} or @code{uchar-h-c23}: @itemize @item This header file is missing on many non-glibc platforms: @@ -27,7 +27,7 @@ This file produces compilation errors in C++ mode on some platforms: AIX 7.2 with xlclang++. @end itemize -Portability problems fixed by Gnulib module @code{uchar-c23}: +Portability problems fixed by Gnulib module @code{uchar-h-c23}: @itemize @item @code{char32_t} values may not be Unicode code points. diff --git a/doc/strings.texi b/doc/strings.texi index e87731adf6..62ded7a0b6 100644 --- a/doc/strings.texi +++ b/doc/strings.texi @@ -857,14 +857,14 @@ values already always were 32-bit and Unicode code points. @code{*c32*} functions are optimized so that on glibc systems they immediately redirect to the corresponding @code{*wc*} functions. -@mindex uchar-c23 +@mindex uchar-h-c23 Gnulib implements the ISO C 23 semantics of @code{char32_t} when you -import the @samp{uchar-c23} module. Without this module, it implements +import the @samp{uchar-h-c23} module. Without this module, it implements only the ISO C 11 semantics; the effect is that on some platforms (macOS, FreeBSD, NetBSD, Solaris) a @code{char32_t} value is the same as a @code{wchar_t} value, not a Unicode code point. Thus, when you want to pass @code{char32_t} values to GNU libunistring or to some Unicode -centric Gnulib functions, you need the @samp{uchar-c23} module in order +centric Gnulib functions, you need the @samp{uchar-h-c23} module in order to do so without portability problems. @node The mbchar_t type diff --git a/lib/uchar.in.h b/lib/uchar.in.h index 1b9487e39f..53c11f4c8f 100644 --- a/lib/uchar.in.h +++ b/lib/uchar.in.h @@ -119,7 +119,7 @@ typedef uint_least16_t gl_char16_t; and newer, it denotes UTF-32 code points; in older versions of ISO C it did so only on platforms on which __STDC_UTF_32__ was defined. In gnulib, we guarantee that it denotes UTF-32 code points if and - only if the module 'uchar-c23' is in use. */ + only if the module 'uchar-h-c23' is in use. */ typedef uint_least32_t char32_t; #elif @GNULIBHEADERS_OVERRIDE_CHAR32_T@ diff --git a/modules/dfa b/modules/dfa index aac8a9866a..d966e6b142 100644 --- a/modules/dfa +++ b/modules/dfa @@ -33,9 +33,9 @@ stdlib-h string-h uchar-h # The lonesome_lower array requires ISO C 23 semantics for char32_t. -# But uchar-c23 has a global effect, therefore leave it to each package +# But uchar-h-c23 has a global effect, therefore leave it to each package # to enable it. -#uchar-c23 +#uchar-h-c23 verify wchar xalloc diff --git a/modules/mbrtoc16 b/modules/mbrtoc16 index c5a0a05122..e5446c7824 100644 --- a/modules/mbrtoc16 +++ b/modules/mbrtoc16 @@ -13,7 +13,7 @@ m4/mbstate_t.m4 Depends-on: uchar-h -uchar-c23 [test $HAVE_MBRTOC16 = 0 || test $REPLACE_MBRTOC16 = 1] +uchar-h-c23 [test $HAVE_MBRTOC16 = 0 || test $REPLACE_MBRTOC16 = 1] mbrtoc32 [test $HAVE_MBRTOC16 = 0 || test $REPLACE_MBRTOC16 = 1] mbsinit [test $HAVE_MBRTOC16 = 0 || test $REPLACE_MBRTOC16 = 1] c99 [test $HAVE_MBRTOC16 = 0 || test $REPLACE_MBRTOC16 = 1] diff --git a/modules/uchar-c23 b/modules/uchar-c23 index 3a12219922..617d3c975c 100644 --- a/modules/uchar-c23 +++ b/modules/uchar-c23 @@ -1,48 +1,20 @@ Description: A in which the char32_t values are always Unicode code points. +Status: +deprecated + +Notice: +This module is deprecated. Use the module 'uchar-h-c23' instead. + Files: -lib/lc-charset-unicode.h -lib/lc-charset-unicode.c Depends-on: -uchar-h -wchar -iconv -localcharset -streq -once -tls -mbszero -wcrtomb -unistr/u8-mbtouc -unistr/u8-uctomb -mbrtowc +uchar-h-c23 configure.ac: -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AM_ICONV]) -AC_DEFINE([GL_CHAR32_T_IS_UNICODE], [1], - [Define if gnulib's char32_t values are always Unicode code points.]) -dnl On macOS, FreeBSD, NetBSD, Solaris, the functions mbrtoc32 and c32rtomb -dnl need to convert between the wchar_t encoding and Unicode. -case "$host_os" in - darwin* | freebsd* | dragonfly* | netbsd* | solaris*) - AC_DEFINE([GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION], [1], - [Define if gnulib needs to convert between the wchar_t encoding and Unicode.]) - LIBC32CONV="$LIBICONV" - LTLIBC32CONV="$LTLIBICONV" - ;; - *) - LIBC32CONV= - LTLIBC32CONV= - ;; -esac -AC_SUBST([LIBC32CONV]) -AC_SUBST([LTLIBC32CONV]) Makefile.am: -lib_SOURCES += lc-charset-unicode.c Include: @@ -55,4 +27,3 @@ License: LGPLv2+ Maintainer: -all diff --git a/modules/uchar-h-c23 b/modules/uchar-h-c23 new file mode 100644 index 0000000000..3a12219922 --- /dev/null +++ b/modules/uchar-h-c23 @@ -0,0 +1,58 @@ +Description: +A in which the char32_t values are always Unicode code points. + +Files: +lib/lc-charset-unicode.h +lib/lc-charset-unicode.c + +Depends-on: +uchar-h +wchar +iconv +localcharset +streq +once +tls +mbszero +wcrtomb +unistr/u8-mbtouc +unistr/u8-uctomb +mbrtowc + +configure.ac: +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AM_ICONV]) +AC_DEFINE([GL_CHAR32_T_IS_UNICODE], [1], + [Define if gnulib's char32_t values are always Unicode code points.]) +dnl On macOS, FreeBSD, NetBSD, Solaris, the functions mbrtoc32 and c32rtomb +dnl need to convert between the wchar_t encoding and Unicode. +case "$host_os" in + darwin* | freebsd* | dragonfly* | netbsd* | solaris*) + AC_DEFINE([GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION], [1], + [Define if gnulib needs to convert between the wchar_t encoding and Unicode.]) + LIBC32CONV="$LIBICONV" + LTLIBC32CONV="$LTLIBICONV" + ;; + *) + LIBC32CONV= + LTLIBC32CONV= + ;; +esac +AC_SUBST([LIBC32CONV]) +AC_SUBST([LTLIBC32CONV]) + +Makefile.am: +lib_SOURCES += lc-charset-unicode.c + +Include: + + +Link: +$(LTLIBUNISTRING) when linking with libtool, $(LIBUNISTRING) otherwise +$(LTLIBC32CONV) when linking with libtool, $(LIBC32CONV) otherwise + +License: +LGPLv2+ + +Maintainer: +all -- 2.39.5