在 2026-9-17 00:55, Zhongteng Gui 写道:
On 2026/09/16 19:31, Evgeny Karpov wrote:The patch below introduces a regression for *-pc-cygwin targets. https://sourceforge.net/p/mingw-w64/mingw-w64/ci/8c4baed92d4dee4fe1874af860a61aa5c945b6f5/CXX aarch64/fastcwd.o In file included from cygwin/winsup/cygwin/local_includes/wchar.h:12, from cygwin/winsup/cygwin/local_includes/winsup.h:109, from winsup/cygwin/aarch64/fastcwd.cc:14: newlib/libc/include/wchar.h:86:20: error: conflicting declaration 'typedef struct _mbstate_t mbstate_t' 86 | typedef _mbstate_t mbstate_t; | ^~~~~~~~~ In file included from include/w32api/crtdefs.h:10, from include/w32api/excpt.h:9, from include/w32api/windows.h:65, from winsup/cygwin/local_includes/winlean.h:58, from winsup/cygwin/local_includes/winsup.h:82: include/w32api/corecrt.h:149:21: note: previous declaration as 'typedef _Mbstatet mbstate_t' 149 | typedef _Mbstatet mbstate_t; Perhaps it might be fixed by wrapping mbstate_t in !defined (__CYGWIN__) in mingw-w64-headers/crt/corecrt.h. Regards, EvgenyThanks for the report, and sorry for the regression. Our CI doesn't test Cygwin build currently. The following patch should fix this regression, though I'm not sure whether this is the best fix. An alternative way is a partial revert of the previous commit and move mbstate_t back to wchar.h. I'm not sure why yvals.h define _Mbstatet (and _Mbstinit) previously. yvals.h from latest MSVC doesn't define this. Maybe this is just for backward compatiablity of older MSVC? If it's ok to remove mbstate stuff from yvals.h, I'd prefer to move mbstate_t back. I'll send another patch if this is preferred. Cc LIU Hao for suggestions. -- From 4adafeb517abd2f288146982a86db02083dcba16 Mon Sep 17 00:00:00 2001 From: Zhongteng Gui <[email protected]> Date: Thu, 17 Sep 2026 00:42:29 +0800 Subject: [PATCH] headers: corecrt.h: Don't define mbstate_t for Cygwin. This fixes 8c4baed92d4dee4fe1874af860a61aa5c945b6f5. Cygwin defines mbstate_t differently themselves. Signed-off-by: Zhongteng Gui <[email protected]> --- mingw-w64-headers/crt/corecrt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mingw-w64-headers/crt/corecrt.h b/mingw-w64-headers/crt/corecrt.h index c3f3a8208..e0f0601e0 100644 --- a/mingw-w64-headers/crt/corecrt.h +++ b/mingw-w64-headers/crt/corecrt.h @@ -141,6 +141,7 @@ typedef __time64_t time_t; #endif #endif /* _TIME_T_DEFINED */+#ifndef __CYGWIN__ /* Cygwin defines mbstate_t themselves */#if defined(_UCRT) || defined(__LARGE_MBSTATE_T) typedef struct _Mbstatet { unsigned long _Wchar; @@ -150,6 +151,7 @@ typedef __time64_t time_t; #else typedef int mbstate_t; #endif +#endif#ifndef _CRT_SECURE_CPP_NOTHROW#define _CRT_SECURE_CPP_NOTHROW throw()
I have pushed this patch with a revised message: headers: corecrt.h: Don't define mbstate_t for Cygwin. This fixes a regression that was caused by 8c4baed92d4dee4fe1874af860a61aa5c945b6f5. Cygwin has its own `mbstate_t` which is different from the Windows one. Signed-off-by: Zhongteng Gui <[email protected]> Reference: https://sourceforge.net/p/mingw-w64/mailman/message/59391723/ Signed-off-by: LIU Hao <[email protected]> -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
