Hi Martin, I'm in favor of applying Pali's patches first. They split mbrtowc.c into three files, while my patches introduce ucrt_mbrtowc.c which includes mbrtowc.c. I think it would be cleaner if mbrtowc.c was split first, and only then three corresponding ucrt_*.c files would be introduced.
If you push this patch series, I'll send updated patches in a few days. - Kirill Makurin ________________________________ From: Martin Storsjö <mar...@martin.st> Sent: Wednesday, August 20, 2025 9:17 PM To: Pali Rohár <pali.ro...@gmail.com> Cc: mingw-w64-public@lists.sourceforge.net <mingw-w64-public@lists.sourceforge.net>; LIU Hao <lh_mo...@126.com>; Kirill Makurin <maiddais...@outlook.com> Subject: Re: [PATCH 0/9] crt: Improve mbrtowc and ___lc_handle_func / ___lc_codepage_func On Fri, 15 Aug 2025, Pali Rohár wrote: > Pali Rohár (9): > crt: Provide emulation of ___lc_handle_func for msvcrt.dll and > msvcrtd.dll > crt: Improve support for ___lc_codepage_func() function > crt: Remove internal mb_wc_common.h and replace it by locale.h usage > crt: Remove static helper function mbrtowc_cp() > crt: Move private state_mbrlen/state_mbrtowc/state_mbsrtowcs variables > to corresponding functions > crt: Replace IsDBCSLeadByteEx() by _ismbblead() in mbrtowc() > crt: Use errno instead of _set_errno in mbrtowc > crt: Split mbrtowc.c into 3 files mbrlen.c mbrtowc.c and mbsrtowcs.c > crt: Use only mbstate_t in mbsrtowcs > > mingw-w64-crt/Makefile.am | 12 +- > mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- > .../{mb_wc_common.h => ___lc_codepage_func.c} | 15 +- > ...cale_func.c => ___lc_codepage_func_emul.c} | 64 ++----- > .../{mb_wc_common.h => ___lc_handle_func.c} | 17 +- > mingw-w64-crt/misc/btowc.c | 2 +- > .../misc/{mb_wc_common.h => mbrlen.c} | 17 +- > mingw-w64-crt/misc/mbrtowc.c | 147 ++------------- > mingw-w64-crt/misc/{mbrtowc.c => mbsrtowcs.c} | 174 +----------------- > mingw-w64-crt/misc/mingw_wcstold.c | 2 - > mingw-w64-crt/misc/wcrtomb.c | 2 +- > mingw-w64-crt/misc/wcstof.c | 2 - > mingw-w64-crt/misc/wctob.c | 2 +- > 13 files changed, 95 insertions(+), 363 deletions(-) > copy mingw-w64-crt/misc/{mb_wc_common.h => ___lc_codepage_func.c} (41%) > rename mingw-w64-crt/misc/{lc_locale_func.c => ___lc_codepage_func_emul.c} > (15%) > copy mingw-w64-crt/misc/{mb_wc_common.h => ___lc_handle_func.c} (39%) > rename mingw-w64-crt/misc/{mb_wc_common.h => mbrlen.c} (38%) > copy mingw-w64-crt/misc/{mbrtowc.c => mbsrtowcs.c} (30%) These patches all look reasonable to me, but if Kirill's patches touch the same, and you agreed on rebasing this on top of their changes once they have landed, we'll wait for that. // Martin _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public