3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 #pragma GCC system_header
27 /* Do not include _mingw.h since _mingw.h includes this file.
32 * Define version masks
33 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx
34 * Values and names are guessed based on comments in the documentation.
36 #define OSVERSION_MASK 0xFFFF0000
37 #define SPVERSION_MASK 0x0000FF00
38 #define SUBVERSION_MASK 0x000000FF
41 * Macros to extract values from NTDDI version.
42 * Derived from comments on MSDN or social.microsoft.com
44 #define OSVER(ver) ((ver) & OSVERSION_MASK)
45 #define SPVER(ver) (((ver) & SPVERSION_MASK) >> 8)
46 #define SUBVER(ver) ((ver) & SUBVERSION_MASK)
49 * Macros to create the minimal NTDDI version from _WIN32_WINNT value.
51 #define NTDDI_VERSION_FROM_WIN32_WINNT(ver) _NTDDI_VERSION_FROM_WIN32_WINNT(ver)
52 #define _NTDDI_VERSION_FROM_WIN32_WINNT(ver) ver##0000
55 * Version constants defining _WIN32_WINNT versions.
56 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx
58 #define _WIN32_WINNT_NT4 0x0400
59 #define _WIN32_WINNT_NT4E 0x0401
60 #define _WIN32_WINNT_WIN95 0x0400
61 #define _WIN32_WINNT_WIN98 0x0410
62 #define _WIN32_WINNT_WINME 0x0490
63 #define _WIN32_WINNT_WIN2K 0x0500
64 #define _WIN32_WINNT_WINXP 0x0501
65 #define _WIN32_WINNT_WS03 0x0502
66 #define _WIN32_WINNT_WIN6 0x0600
67 #define _WIN32_WINNT_VISTA 0x0600
68 #define _WIN32_WINNT_WS08 0x0600
69 #define _WIN32_WINNT_LONGORN 0x0600
70 #define _WIN32_WINNT_WIN7 0x0601
73 * Version constants defining _WIN32_IE versions.
74 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx
76 #define _WIN32_IE_IE50 0x0500
77 #define _WIN32_IE_IE501 0x0501
78 #define _WIN32_IE_IE55 0x0550
79 #define _WIN32_IE_IE60 0x0600
80 #define _WIN32_IE_IE60SP1 0x0601
81 #define _WIN32_IE_IE60SP2 0x0603
82 #define _WIN32_IE_IE70 0x0700
83 #define _WIN32_IE_IE80 0x0800
86 * Version constants defining NTDDI_VERSION.
87 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx
89 #define __NTDDI_WIN5 0x05000000
90 #define __NTDDI_WIN51 0x05010000
91 #define __NTDDI_WIN52 0x05020000
92 #define __NTDDI_WIN6 0x06000000
93 #define __NTDDI_WIN61 0x06010000
94 #define __NTDDI_SP0 0x00000000
95 #define __NTDDI_SP1 0x00000100
96 #define __NTDDI_SP2 0x00000200
97 #define __NTDDI_SP3 0x00000300
98 #define __NTDDI_SP4 0x00000400
100 #define NTDDI_WIN2K __NTDDI_WIN5 + __NTDDI_SP0
101 #define NTDDI_WIN2KSP1 __NTDDI_WIN5 + __NTDDI_SP1
102 #define NTDDI_WIN2KSP2 __NTDDI_WIN5 + __NTDDI_SP2
103 #define NTDDI_WIN2KSP3 __NTDDI_WIN5 + __NTDDI_SP3
104 #define NTDDI_WIN2KSP4 __NTDDI_WIN5 + __NTDDI_SP4
106 #define NTDDI_WINXP __NTDDI_WIN51 + __NTDDI_SP0
107 #define NTDDI_WINXPSP1 __NTDDI_WIN51 + __NTDDI_SP1
108 #define NTDDI_WINXPSP2 __NTDDI_WIN51 + __NTDDI_SP2
109 #define NTDDI_WINXPSP3 __NTDDI_WIN51 + __NTDDI_SP3
111 #define NTDDI_WS03 __NTDDI_WIN52 + __NTDDI_SP0
112 #define NTDDI_WS03SP1 __NTDDI_WIN52 + __NTDDI_SP1
113 #define NTDDI_WS03SP2 __NTDDI_WIN52 + __NTDDI_SP2
115 #define NTDDI_VISTA __NTDDI_WIN6 + __NTDDI_SP0
116 #define NTDDI_VISTASP1 __NTDDI_WIN6 + __NTDDI_SP1
117 #define NTDDI_VISTASP2 __NTDDI_WIN6 + __NTDDI_SP2
119 #define NTDDI_LONGHORN NTDDI_VISTA
121 #define NTDDI_WIN6 NTDDI_VISTA
122 #define NTDDI_WIN6SP1 NTDDI_VISTASP1
123 #define NTDDI_WIN6SP2 NTDDI_VISTASP2
125 #define NTDDI_WS08 __NTDDI_WIN6 + __NTDDI_SP1
127 #define NTDDI_WIN7 __NTDDI_WIN61 + __NTDDI_SP0
134 # if _WIN32_WINNT != OSDIR(NTDDI_VERSION)
135 # error The _WIN32_WINNT value does not match NTDDI_VERSION
138 # define _WIN32_WINNT OSVER(NTDDI_VERSION)
140 # define WINVER _WIN32_WINNT
147 # define _WIN32_WINNT WINVER
149 # ifdef _WARN_DEFAULTS
150 # warning _WIN32_WINNT is defaulting to _WIN32_WINNT_WIN2K
152 # define _WIN32_WINNT _WIN32_WINNT_WIN2K
157 # define WINVER _WIN32_WINNT
160 #ifndef NTDDI_VERSION
161 # ifdef _WARN_DEFAULTS
162 # warning NTDDI_VERSION is defaulting to _WIN32_WINNT version SPK0
164 # define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)