https://gcc.gnu.org/g:49f3e5d51a00ac8e5057eca51606742bdcf2a966
commit r17-5485-g49f3e5d51a00ac8e5057eca51606742bdcf2a966 Author: LIU Hao <[email protected]> Date: Fri Jan 6 23:18:15 2023 +0800 Always define `WIN32_LEAN_AND_MEAN` before <windows.h> This is the leftover part in r13-5055-g902c755930326c. Recently, mingw-w64 has got updated <msxml.h> from Wine which is included indirectly by <windows.h> if `WIN32_LEAN_AND_MEAN` is not defined. The `IXMLDOMDocument` class has a member function named `abort()`, which gets affected by our `abort()` macro in "system.h". `WIN32_LEAN_AND_MEAN` should, nevertheless, always be defined. This can exclude 'APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets' [1], and speed up compilation of these files a bit. [1] https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers ChangeLog: PR middle-end/108300 * libgo/misc/cgo/test/callback_c.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. Co-authored-by: Zhongteng Gui <[email protected]> Signed-off-by: Zhongteng Gui <[email protected]> Signed-off-by: Jonathan Yong <[email protected]> Diff: --- libgo/misc/cgo/test/callback_c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libgo/misc/cgo/test/callback_c.c b/libgo/misc/cgo/test/callback_c.c index 8921b7306c6b..ee9397cb4964 100644 --- a/libgo/misc/cgo/test/callback_c.c +++ b/libgo/misc/cgo/test/callback_c.c @@ -32,6 +32,7 @@ IntoC(void) } #ifdef WIN32 +#define WIN32_LEAN_AND_MEAN #include <windows.h> long long mysleep(int seconds) {
