From 902c755930326cb4405672aa3ea13c35c653cbff Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 6 Jan 2023 23:18:15 +0800 Subject: Always define `WIN32_LEAN_AND_MEAN` before Recently, mingw-w64 has got updated from Wine which is included indirectly by 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 gcc/ PR middle-end/108300 * config/xtensa/xtensa-dynconfig.c: Define `WIN32_LEAN_AND_MEAN` before . * diagnostic-color.cc: Likewise. * plugin.cc: Likewise. * prefix.cc: Likewise. gcc/ada/ PR middle-end/108300 * adaint.c: Define `WIN32_LEAN_AND_MEAN` before `#include `. * cio.c: Likewise. * ctrl_c.c: Likewise. * expect.c: Likewise. * gsocket.h: Likewise. * mingw32.h: Likewise. * mkdir.c: Likewise. * rtfinal.c: Likewise. * rtinit.c: Likewise. * seh_init.c: Likewise. * sysdep.c: Likewise. * terminals.c: Likewise. * tracebak.c: Likewise. gcc/jit/ PR middle-end/108300 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before . libatomic/ PR middle-end/108300 * config/mingw/lock.c: Define `WIN32_LEAN_AND_MEAN` before . libffi/ PR middle-end/108300 * src/aarch64/ffi.c: Define `WIN32_LEAN_AND_MEAN` before . libgcc/ PR middle-end/108300 * config/i386/enable-execute-stack-mingw32.c: Define `WIN32_LEAN_AND_MEAN` before . * libgcc2.c: Likewise. * unwind-generic.h: Likewise. libgfortran/ PR middle-end/108300 * intrinsics/sleep.c: Define `WIN32_LEAN_AND_MEAN` before . libgomp/ PR middle-end/108300 * config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before . libiberty/ PR middle-end/108300 * make-temp-file.c: Define `WIN32_LEAN_AND_MEAN` before . * pex-win32.c: Likewise. libssp/ PR middle-end/108300 * ssp.c: Define `WIN32_LEAN_AND_MEAN` before . libstdc++-v3/ PR middle-end/108300 * src/c++11/system_error.cc: Define `WIN32_LEAN_AND_MEAN` before . * src/c++11/thread.cc: Likewise. * src/c++17/fs_ops.cc: Likewise. * src/filesystem/ops.cc: Likewise. libvtv/ PR middle-end/108300 * vtv_malloc.cc: Define `WIN32_LEAN_AND_MEAN` before . * vtv_rts.cc: Likewise. * vtv_utils.cc: Likewise. --- libvtv/vtv_malloc.cc | 1 + libvtv/vtv_rts.cc | 1 + libvtv/vtv_utils.cc | 1 + 3 files changed, 3 insertions(+) (limited to 'libvtv') diff --git a/libvtv/vtv_malloc.cc b/libvtv/vtv_malloc.cc index 67c5de6d4e9..31b334fa7a2 100644 --- a/libvtv/vtv_malloc.cc +++ b/libvtv/vtv_malloc.cc @@ -33,6 +33,7 @@ #include #include #if defined (__CYGWIN__) || defined (__MINGW32__) +#define WIN32_LEAN_AND_MEAN #include #else #include diff --git a/libvtv/vtv_rts.cc b/libvtv/vtv_rts.cc index ae9e6b6955a..6954b0417b6 100644 --- a/libvtv/vtv_rts.cc +++ b/libvtv/vtv_rts.cc @@ -121,6 +121,7 @@ #include #include #if defined (__CYGWIN__) || defined (__MINGW32__) +#define WIN32_LEAN_AND_MEAN #include #include #include diff --git a/libvtv/vtv_utils.cc b/libvtv/vtv_utils.cc index ed5c7711c44..21c3466afb9 100644 --- a/libvtv/vtv_utils.cc +++ b/libvtv/vtv_utils.cc @@ -33,6 +33,7 @@ #include #include #if defined (__CYGWIN__) || defined (__MINGW32__) +#define WIN32_LEAN_AND_MEAN #include #else #include -- cgit v1.2.1