在 2024-10-11 18:30, Martin Storsjö 写道:
I wonder if the right solution here would be to amend the __MSVCRT_VERSION__ checks with checks for _WIN32_WINNT; if _WIN32_WINNT is set to a new enough version, declarations are visible for functions that only exist in new enough versions. And if you want to target older versions, just don't call those functions (and define _WIN32_WINNT to a lower version if you want to get the errors for it early enough).

Does it make any sense to dedicate a version number for MSVCRT, for example, `#define __MSVCRT_VERSION__ 0x07FF` ?

There's risk that this can affect code which checks for 0x700 explicitly; then I would prefer your second option. I am assuming that in practice the use of MSVCR7[01] is rare.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to