From: Paul Eggert Date: Thu, 23 Apr 2026 19:59:52 +0000 (-0700) Subject: wchar-h: namespace cleanup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5926e89900ffe4c850dd026fb634c15bf3cee526;p=thirdparty%2Fgnulib.git wchar-h: namespace cleanup Do not pollute includers with names on GCC-compatible platforms. * lib/wchar.in.h (_GL_WCHAR_MEMSET) [@GNULIB_MBSZERO@]: New macro. (mbszero): Use it. --- diff --git a/ChangeLog b/ChangeLog index cbadb6f687..3d5eeade61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2026-04-23 Paul Eggert + + wchar-h: namespace cleanup + Do not pollute includers with names + on GCC-compatible platforms. + * lib/wchar.in.h (_GL_WCHAR_MEMSET) [@GNULIB_MBSZERO@]: New macro. + (mbszero): Use it. + 2026-04-19 Jim Meyering maint.mk: fix sc_Wundef_boolean race with parallel syntax-check diff --git a/lib/wchar.in.h b/lib/wchar.in.h index a60a4dfc67..29ecd92f5c 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -258,8 +258,15 @@ _GL_EXTERN_C void free (void *); #if @GNULIB_MBSZERO@ -/* Get memset(). */ -# include +# ifdef __has_builtin +# if __has_builtin (__builtin_memset) +# define _GL_WCHAR_MEMSET __builtin_memset +# endif +# endif +# ifndef _GL_WCHAR_MEMSET +# include +# define _GL_WCHAR_MEMSET memset +# endif #endif @@ -587,7 +594,7 @@ _GL_INLINE _GL_ARG_NONNULL ((1)) void mbszero (mbstate_t *ps) { - memset (ps, 0, _GL_MBSTATE_ZERO_SIZE); + _GL_WCHAR_MEMSET (ps, 0, _GL_MBSTATE_ZERO_SIZE); } # define GNULIB_defined_mbszero 1 # endif