在 2022-12-24 01:48, Jeremy Drake via Mingw-w64-public 写道:
I recently discovered that llvm's libc++ has something similar. MSYS2 recently bumped their default _WIN32_WINNT to Windows 8.1, and the libc++ built after that no longer worked on Windows 7. I was of the understanding that that macro was intended to be set by project code, and just controlled what APIs were made available by the headers, and the project code could simply not call anything from a newer version. But it seems that some projects treat it instead as telling *them* what APIs they can call, and that results in it being a minimum supported OS version. I didn't know MS explicitly called it out as such in a doc somewhere.
For MSYS2 I think that's probably desired. People who set `_WIN32_WINNT` to a specific version should be supposed to be requesting some APIs of that version. If there are newer and better APIs why not use them? There's nothing wrong with that.
The commit that bumped the default value of `_WIN32_WINNT` was an attempt to match Windows SDK. There's nothing wrong with that, either.
The only issue in this thread seems to be inside GNU lib because it relies on the default value. That's probably not good; however, given GNU lib users are less likely to be aware of this Windows-specific macro, maybe we can propose GNU lib should set a default, safer value, if no one is given elsewhere. BTW I do think that `_WIN32_WINNT` should always be set when compiling Windows code.
-- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
