[Mingw-users] btowc problem

Back to archive index
Eli Zaretskii eliz****@gnu*****
Sat Jul 4 00:01:10 JST 2020


> From: Keith Marshall <keith****@users*****>
> Date: Fri, 3 Jul 2020 14:54:02 +0100
> 
> > But we could instead look for these functions explicitly in
> > MSVCRT.DLL, not in all of the loaded modules, couldn't we?
> 
> But that presupposes that the application is linked with MSVCRT.DLL; it
> will fail, if the user links with any of MSVC's non-free MSVCRn.DLLs,
> (which we do endeavour to support).  Dealing with that is a complexity
> with which I would prefer not to contend.

Indeed.  Though we could decide that MS implementations are supported
only if they are in MSVCRT.DLL, i.e. leave MSVCRn.DLL unsupported.

But I agree that it is not very important for MinGW to provide an
option for using MS btowc.  I don't really see any important use cases
that would require it.

> > However, if this is not a good idea, then yes, I think having these
> > functions in libmingwex that redirect to __mingw_* replacements
> > unconditionally is a good-enough solution.
> 
> This would be my preference ... indeed, it always has been, but the
> question arose: why not use the MSVCRx.DLL implementations?  I never
> really wanted to do so, but when I invited opinion, no one offered any.

I'm sorry I didn't voice my opinion back then.  Perhaps I just didn't
have one, or didn't understand the implications.

> What I propose, for mingwrt-5.4, is to rename __mingw_btowc, et al, back
> to their original ISO-C99 names, in libmingwex.a.  Of course, this will
> cut off access to the MSVCRx.DLL variants, but I'm not too bothered by
> that, since a) it was always thus, prior to mingwrt-5.3.x, and b) I
> strongly suspect that the Microsoft implementations are unfit for
> purpose, anyway.  I would then like to delete the __mingw_btowc et al,
> and __msvcrt_btowc et al redirectors, (since they will no longer be
> useful); however, if you think it may be prudent to keep them as simple
> aliases for the ISO-C99 names, in the interim, I can do so for 5.4, but
> I would really like them to be gone, by the time we get to mingwrt-5.5.

The only reason I can think of to keep the __msvcrt_* and __mingw_*
redirectors is to allow people who have libraries compiled with
mingwrt-5.3.x to link against them without recompiling.  I'm generally
biased towards backward compatibility, but since you are doing the
work, it's your call.  If mingwrt-5.4 is going to be released soon,
perhaps the window during which 5.3.x will have been used could be
considered small enough to not present a significant problem.

Thanks.



More information about the MinGW-Users mailing list
Back to archive index