The 2026-04-24 change in module 'regex' introduced a warning
in MSVC builds:

/home/bruno/msvc/compile cl -nologo -std:c11 -DHAVE_CONFIG_H -I. 
-I../../../../gettext-tools/libgrep/gnulib-lib -I../..  
-I../../../gettext-runtime/intl -I../../gnulib-lib 
-I../../../../gettext-tools/gnulib-lib -DIN_GETTEXT_TOOLS_LIBGREP=1 
-D_WIN32_WINNT=_WIN32_WINNT_WIN7 -I/usr/local/msvc64/include    -MD -c -o 
libgnu_a-regex.obj `if test -f 'regex.c'; then cygpath -w 'regex.c'; else 
cygpath -w '../../../../gettext-tools/libgrep/gnulib-lib/regex.c'; fi`
regex.c
C:\cygwin64\home\bruno\gettext-20260512-static\gettext-tools\libgrep\gnulib-lib\regex_internal.h(138):
 warning C4005: 'wctype_t': macro redefinition
.\wctype.h(1180): note: see previous definition of 'wctype_t'

This patch fixes it. Adding one more #undef should be acceptable also
for glibc, later.


2026-05-13  Bruno Haible  <[email protected]>

        regex: Fix "macro redefinition" warning on MSVC.
        * lib/regex_internal.h (wctype_t): Undefine before redefining it.

diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 1ffa905e95..2409170b0a 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -125,6 +125,7 @@
 # include <wctype.h>
 #else
 # include <uchar.h>
+# undef wctype_t
 # undef __wctype
 # undef __iswalnum
 # undef __iswctype




Reply via email to