Do not pollute <wchar.h> includers with <string.h> names
on GCC-compatible platforms.
* lib/wchar.in.h (_GL_WCHAR_MEMSET) [@GNULIB_MBSZERO@]: New macro.
(mbszero): Use it.
+2026-04-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ wchar-h: <string.h> namespace cleanup
+ Do not pollute <wchar.h> includers with <string.h> names
+ on GCC-compatible platforms.
+ * lib/wchar.in.h (_GL_WCHAR_MEMSET) [@GNULIB_MBSZERO@]: New macro.
+ (mbszero): Use it.
+
2026-04-19 Jim Meyering <meyering@fb.com>
maint.mk: fix sc_Wundef_boolean race with parallel syntax-check
#if @GNULIB_MBSZERO@
-/* Get memset(). */
-# include <string.h>
+# ifdef __has_builtin
+# if __has_builtin (__builtin_memset)
+# define _GL_WCHAR_MEMSET __builtin_memset
+# endif
+# endif
+# ifndef _GL_WCHAR_MEMSET
+# include <string.h>
+# define _GL_WCHAR_MEMSET memset
+# endif
#endif
_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