Also keep in mind that value of _WIN32_WINNT also affects the size of output.
Other than compilation time, the other case where it may be relevant is IDEs/Editors which provide Intellisense. For example, I'm using Visual Studio Code with Microsoft's extension for C/C++. I think defining WIN32_LEAN_AND_MEAN may make things work somewhat faster, especially for MSVC. ________________________________ From: Martin Storsjö <[email protected]> Sent: Saturday, September 13, 2025 1:14 AM To: mingw-w64-public <[email protected]> Cc: Pali Rohár <[email protected]> Subject: Re: [Mingw-w64-public] Is WIN32_LEAN_AND_MEAN needed in mingw-w64 runtime files? On Fri, 29 Aug 2025, Kirill Makurin wrote: > I once tried to compare output of `cpp -include windows.h` with and > without WIN32_LEAN_AND_MEAN . > > If I remember correctly, output without `-DWIN32_LEAN_AND_MEAN` > contained about 100K lines of code, while output with > `-DWIN32_LEAN_AND_MEAN` contained about 67K lines of code. This is quite close to current numbers; I just checked, and for x86_64 (with clang), I got 91k lines normally and 55k with -DWIN32_LEAN_AND_MEAN. With MSVC, the difference is much bigger though. Normally, it brings in 317k lines, and with -DWIN32_LEAN_AND_MEAN, it's down to 169k lines. // Martin _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
