在 2023-01-21 12:05, Eli Zaretskii via Gcc 写道:
I'm not sure I follow the logic. A program that calls GetModuleHandleW will refuse to start on Windows that doesn't have that API. So any version before XP is automatically excluded the moment you use code which calls that API directly (i.e. not through a function pointer or somesuch).
Are _you_ still willing to maintain backward compatibility with Windows 9x? Even mingw-w64 has been defaulting to Windows Server 2003 since 2007. Why would anyone build a modern compiler for such old operating systems?
With any Windows that is modern enough, wide APIs should always be preferred to ANSI ones, especially when the argument is constant. Almost all ANSI APIs (the only exception I know of is `OutputDebugStringA` which does the inverse) translate their ANSI string arguments to wide strings and delegate to wide ones, so by calling wide APIs explicitly, such overhead can be avoided.
-- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature