Yes, I meant corecrt_w*.h header files in general. You can see what I meant in my patch series for conio.h. I plan to do similar for other CRT header files as well, but one at the time.
Thanks for information about `isascii`, I was unaware of this. - Kirill Makurin ________________________________ From: LIU Hao Sent: Thursday, January 15, 2026 11:41 AM To: [email protected]; Kirill Makurin Cc: Pali Rohár Subject: Re: [Mingw-w64-public] Add missing _CRTIMP for some functions 在 2025-12-18 14:23, Kirill Makurin 写道: > This patch series adds missing _CRTIMP in declarations of some functions in > several header files. There are still many places where _CRTIMP is missing, > I'll try to take care of them later. Thanks. I have pushed this series of patches now. > There are a few things I've noticed and would like to mention: > > First, we have duplicating (guarded) declarations in multiple header files, > such as various wcs* functions are declared in both wchar.h and string.h. > Should we move them to a separate header file, similarly to what MSVC does, > with headers like correct_wchar.h? If you meant corecrt_wchar.h.. I don't see such a header from MSVC. > Second, mingw-w64 ctype.h declared four functions as external: isascii, > toascii, iscsymf and iscsym. They all are aliases for the same functions but > with two leading underscores (e.g. __isascii). They are declared with > _CRTIMP, which does not seem correct to me. MSVC does not provide these four > functions as externals, so I think it would be better to remove _CRTIMP. `isascii()` can be found in an old SDK (e.g. Platform SDK for Windows 2003) where there's _CRTIMP. > Third, should we add _CRTIMP at least for some of wcs*/str* functions, such > as {wcs,str}spn? It seems that MSVC declares at least > {wcs,str}{cspn,spn,pbrk} with _ACRTIMP, so I think it safe to add _CRTIMP at > least for those? I hesitate to touch the rest. It makes sense for functions that are likely to be imported from DLLs, as it eliminates a little overhead under such circumstances. For functions that are emulated, such as `mbrlen()`, there's likely no difference. -- Best regards, LIU Hao _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
