Set _WIN32_WINNT to 0x0600 (Windows Vista)?
Motivation
Microsoft stopped supporting Windows XP in April 2014, and Windows Server 2003 in July 2015, and GHC dropped support for Windows XP from GHC 8.0.1 (May 2016). The version of MSYS2 included with GHC, includes (in \mingw\x86_64-w64-mingw32\include\_mingw.h
):
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x502
#endif
0x502
specifies Windows Server 2003 (see: https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2019).
I think this causes _WIN32_WINNT
to be defined as 0x502
when GHC pre-processes and compiles etc.
Code in the Win32
package has to force _WIN32_WINNT
(and WINVER
) to be 0x0600
(Windows Vista). See, for example, module System.Win32.MinTTY
.
Proposal
I propose that before _mingw.h
is reached, somewhere in the GHC code base, _WIN32_WINNT
is defined to be 0x0600
if it is not already defined:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
This would make _WIN32_WINNT
consistent with what GHC actually supports.