xref: /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/core/sys/windows/w32api.d (revision 0a3071956a3a9fdebdbf7f338cf2d439b45fc728)
1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW API for MS-Windows 4.0
5  *
6  * Authors: Stewart Gordon
7  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
8  * Source: $(DRUNTIMESRC core/sys/windows/_w32api.d)
9  */
10 module core.sys.windows.w32api;
version(Windows)11 version (Windows):
12 @system:
13 
14 version (ANSI) {} else version = Unicode;
15 
16 enum __W32API_VERSION = 3.17;
17 enum __W32API_MAJOR_VERSION = 3;
18 enum __W32API_MINOR_VERSION = 17;
19 
20 /*  These version identifiers are used to specify the minimum version of Windows that an
21  *  application will support.
22  *
23  *  Previously the minimum Windows 9x and Windows NT versions could be specified.  However, since
24  *  Windows 9x is no longer supported, either by Microsoft or by DMD, this distinction has been
25  *  removed in order to simplify the bindings.
26  */
version(Windows10)27  version (Windows10) {
28     enum uint _WIN32_WINNT = 0xA00;
29 } else version (Windows8_1) {    // also Windows2012R2
30     enum uint _WIN32_WINNT = 0x603;
version(Windows8)31 } else version (Windows8) {      // also Windows2012
32     enum uint _WIN32_WINNT = 0x602;
33 } else version (Windows7) {      // also Windows2008R2
34     enum uint _WIN32_WINNT = 0x601;
version(WindowsVista)35 } else version (WindowsVista) {  // also Windows2008
36     enum uint _WIN32_WINNT = 0x600;
37 } else version (Windows2003) {   // also WindowsHomeServer, WindowsXP64
38     enum uint _WIN32_WINNT = 0x502;
version(WindowsXP)39 } else version (WindowsXP) {
40     enum uint _WIN32_WINNT = 0x501;
41 } else version (Windows2000) {
42     // Current DMD doesn't support any version of Windows older than XP,
43     // but third-party compilers could use this
44     enum uint _WIN32_WINNT = 0x500;
45 } else {
46     enum uint _WIN32_WINNT = 0x501;
47 }
48 
version(IE11)49 version (IE11) {
50     enum uint _WIN32_IE = 0xA00;
51 } else version (IE10) {
52     enum uint _WIN32_IE = 0xA00;
version(IE9)53 } else version (IE9) {
54     enum uint _WIN32_IE = 0x900;
55 } else version (IE8) {
56     enum uint _WIN32_IE = 0x800;
version(IE7)57 } else version (IE7) {
58     enum uint _WIN32_IE = 0x700;
59 } else version (IE602) {
60     enum uint _WIN32_IE = 0x603;
version(IE601)61 } else version (IE601) {
62     enum uint _WIN32_IE = 0x601;
63 } else version (IE6) {
64     enum uint _WIN32_IE = 0x600;
version(IE56)65 } else version (IE56) {
66     enum uint _WIN32_IE = 0x560;
67 } else version (IE55) {
68     enum uint _WIN32_IE = 0x550;
version(IE501)69 } else version (IE501) {
70     enum uint _WIN32_IE = 0x501;
71 } else version (IE5) {
72     enum uint _WIN32_IE = 0x500;
version(IE401)73 } else version (IE401) {
74     enum uint _WIN32_IE = 0x401;
75 } else version (IE4) {
76     enum uint _WIN32_IE = 0x400;
version(IE3)77 } else version (IE3) {
78     enum uint _WIN32_IE = 0x300;
79 } else static if (_WIN32_WINNT >= 0x500) {
80     enum uint _WIN32_IE = 0x600;
81 } else static if (_WIN32_WINNT >= 0x410) {
82     enum uint _WIN32_IE = 0x400;
83 } else {
84     enum uint _WIN32_IE = 0;
85 }
86 
debug(WindowsUnitTest)87 debug (WindowsUnitTest) {
88     unittest {
89         printf("Windows NT version: %03x\n", _WIN32_WINNT);
90         printf("IE version:         %03x\n", _WIN32_IE);
91     }
92 }
93 
version(Unicode)94 version (Unicode) {
95     enum bool _WIN32_UNICODE = true;
96     package template DECLARE_AW(string name) {
97         mixin("alias " ~ name ~ "W " ~ name ~ ";");
98     }
99 } else {
100     enum bool _WIN32_UNICODE = false;
DECLARE_AW(string name)101     package template DECLARE_AW(string name) {
102         mixin("alias " ~ name ~ "A " ~ name ~ ";");
103     }
104 }
105