On Saturday 19 October 2024 09:15:24 LIU Hao wrote: > 在 2024-10-19 04:36, Martin Storsjö 写道: > > But you're right that technically, msvcrt.dll is more of a 6.0 than a > > 7.0 msvcrt (although it has gotten many additions on top of the original > > one from MSVC 6.0). I guess we could use 0x6FF as well, to allow us to > > distinguish that we mean msvcrt.dll as shipped with an OS, including > > possibly all the new stuff that come with it in newer versions, rather > > than the strict msvcrt.dll from MSVC 6.0. > > I don't agree with this, partly because of the reason you have mentioned > below, and partly because that almost all pre-installed MSVCRT.DLL variants > through Windows XP to Windows 11 have versions like 7.0.x.y (rumor says on > Windows 2000 SP4 it was 6.1 which I am not too interested).
That is truth. FILEVERSION field in PE resource of all msvcrt.dll since Windows XP is 7.0.<build>. Windows ME and 2000 has 6.1.<build>. Win98 SE has 6.0.<build>. Win98 FE has 5.0.<build>. Windows NT 4.0 has 4.20.<build>. But do we need to match __MSVCRT_VERSION__ in header files with this FILEVERSION field stored in system msvcrt.dll? Because I think that this versioning scheme 7.0.<build> is crippled. It is not linear compared with version field in other msvcr*.dll libraries from VC++, and it makes more complex to express minimal version in header files for particular symbol. In my opinion, the ABI provided by the DLL library (list of symbols + library export name) is more important for header files and building application, than some number stored in the library itself. Also with __MSVCRT_VERSION__=0x600 for system os msvcrt.dll it would be simple to map any DLL CRT name to __MSVCRT_VERSION__ and vice-versa. Anyway, current scheme for __MSVCRT_VERSION__ is that its high byte is major number and low byte is minor number. So it means that WinXP+ msvcrt.dll os library (which has version 7.0) needs to have __MSVCRT_VERSION__ set to 0x700. And this is an issue, because it is not possible to distinguish between msvcr70.dll which does not contain Vista+ symbols and Vista's msvcrt.dll which contains those symbols. So using version number from os system msvcrt.dll library into __MSVCRT_VERSION__ just makes it more complicated. It would be needed to introduce new macro, something like __MSVCRT_VERSION_SYSTEM__. > > > > If we do that, we need to revisit most of our current checks for > > __MSVCRT_VERSION__ as well. > > > > // Martin > > > -- > Best regards, > LIU Hao _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
