annotate gcc/ada/mingw32.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /****************************************************************************
kono
parents:
diff changeset
2 * *
kono
parents:
diff changeset
3 * GNAT COMPILER COMPONENTS *
kono
parents:
diff changeset
4 * *
kono
parents:
diff changeset
5 * M I N G W 3 2 *
kono
parents:
diff changeset
6 * *
kono
parents:
diff changeset
7 * C Header File *
kono
parents:
diff changeset
8 * *
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 * Copyright (C) 2002-2018, Free Software Foundation, Inc. *
111
kono
parents:
diff changeset
10 * *
kono
parents:
diff changeset
11 * GNAT is free software; you can redistribute it and/or modify it under *
kono
parents:
diff changeset
12 * terms of the GNU General Public License as published by the Free Soft- *
kono
parents:
diff changeset
13 * ware Foundation; either version 3, or (at your option) any later ver- *
kono
parents:
diff changeset
14 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
kono
parents:
diff changeset
15 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
kono
parents:
diff changeset
16 * or FITNESS FOR A PARTICULAR PURPOSE. *
kono
parents:
diff changeset
17 * *
kono
parents:
diff changeset
18 * As a special exception under Section 7 of GPL version 3, you are granted *
kono
parents:
diff changeset
19 * additional permissions described in the GCC Runtime Library Exception, *
kono
parents:
diff changeset
20 * version 3.1, as published by the Free Software Foundation. *
kono
parents:
diff changeset
21 * *
kono
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License and *
kono
parents:
diff changeset
23 * a copy of the GCC Runtime Library Exception along with this program; *
kono
parents:
diff changeset
24 * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see *
kono
parents:
diff changeset
25 * <http://www.gnu.org/licenses/>. *
kono
parents:
diff changeset
26 * *
kono
parents:
diff changeset
27 * GNAT was originally developed by the GNAT team at New York University. *
kono
parents:
diff changeset
28 * Extensive contributions were provided by Ada Core Technologies Inc. *
kono
parents:
diff changeset
29 * *
kono
parents:
diff changeset
30 ****************************************************************************/
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 /* This file provides some macros used for the MINGW32 platform. The main
kono
parents:
diff changeset
33 goal is to be able to build GNAT with a standard MINGW32 C header
kono
parents:
diff changeset
34 set. This files contains also the circuitry for the unicode support. */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 #ifndef _MINGW32_H
kono
parents:
diff changeset
37 #define _MINGW32_H
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 #include <_mingw.h>
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 #ifndef RTX
kono
parents:
diff changeset
42 #define GNAT_UNICODE_SUPPORT
kono
parents:
diff changeset
43 #define _UNICODE /* For C runtime */
kono
parents:
diff changeset
44 #define UNICODE /* For Win32 API */
kono
parents:
diff changeset
45 #endif
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 /* We need functionality available only starting with Windows XP */
kono
parents:
diff changeset
48 #ifndef _WIN32_WINNT
kono
parents:
diff changeset
49 #define _WIN32_WINNT 0x0501
kono
parents:
diff changeset
50 #endif
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 #ifndef __CYGWIN__
kono
parents:
diff changeset
53 #include <tchar.h>
kono
parents:
diff changeset
54 #endif
kono
parents:
diff changeset
55 #if defined (__CYGWIN__) && !defined (__CYGWIN32__) && !defined (IN_RTS)
kono
parents:
diff changeset
56 /* Note: windows.h on cygwin-64 includes x86intrin.h which uses malloc.
kono
parents:
diff changeset
57 That fails to compile, if malloc is poisoned, i.e. if !IN_RTS. */
kono
parents:
diff changeset
58 #define _X86INTRIN_H_INCLUDED
kono
parents:
diff changeset
59 #endif
kono
parents:
diff changeset
60 #include <windows.h>
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 /* After including this file it is possible to use the character t as prefix
kono
parents:
diff changeset
63 to routines. If GNAT_UNICODE_SUPPORT is defined then the unicode enabled
kono
parents:
diff changeset
64 versions will be used. */
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 /* Copy to/from wide-string, if GNAT_UNICODE_SUPPORT activated this will do
kono
parents:
diff changeset
67 the proper translations using the UTF-8 encoding. */
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #ifdef GNAT_UNICODE_SUPPORT
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 extern UINT __gnat_current_codepage;
kono
parents:
diff changeset
72 extern UINT __gnat_current_ccs_encoding;
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 /* Macros to convert to/from the code page specified in
kono
parents:
diff changeset
75 __gnat_current_codepage. */
kono
parents:
diff changeset
76 #define S2WSC(wstr,str,len) \
kono
parents:
diff changeset
77 MultiByteToWideChar (__gnat_current_codepage,0,str,-1,wstr,len)
kono
parents:
diff changeset
78 #define WS2SC(str,wstr,len) \
kono
parents:
diff changeset
79 WideCharToMultiByte (__gnat_current_codepage,0,wstr,-1,str,len,NULL,NULL)
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 /* Macros to convert to/from UTF-8 code page. */
kono
parents:
diff changeset
82 #define S2WSU(wstr,str,len) \
kono
parents:
diff changeset
83 MultiByteToWideChar (CP_UTF8,0,str,-1,wstr,len)
kono
parents:
diff changeset
84 #define WS2SU(str,wstr,len) \
kono
parents:
diff changeset
85 WideCharToMultiByte (CP_UTF8,0,wstr,-1,str,len,NULL,NULL)
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 /* Macros to convert to/from Windows default code page. */
kono
parents:
diff changeset
88 #define S2WS(wstr,str,len) \
kono
parents:
diff changeset
89 MultiByteToWideChar (CP_ACP,0,str,-1,wstr,len)
kono
parents:
diff changeset
90 #define WS2S(str,wstr,len) \
kono
parents:
diff changeset
91 WideCharToMultiByte (CP_ACP,0,wstr,-1,str,len,NULL,NULL)
kono
parents:
diff changeset
92 #else
kono
parents:
diff changeset
93 #define S2WSC(wstr,str,len) strncpy(wstr,str,len)
kono
parents:
diff changeset
94 #define WS2SC(str,wstr,len) strncpy(str,wstr,len)
kono
parents:
diff changeset
95 #define S2WSU(wstr,str,len) strncpy(wstr,str,len)
kono
parents:
diff changeset
96 #define WS2SU(str,wstr,len) strncpy(str,wstr,len)
kono
parents:
diff changeset
97 #define S2WS(wstr,str,len) strncpy(wstr,str,len)
kono
parents:
diff changeset
98 #define WS2S(str,wstr,len) strncpy(str,wstr,len)
kono
parents:
diff changeset
99 #endif
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 #include <stdlib.h>
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 /* STD_MINGW: standard if MINGW32 version > 1.3, we have switched to this
kono
parents:
diff changeset
104 version instead of the previous enhanced version to ease building GNAT on
kono
parents:
diff changeset
105 Windows platforms. By using STD_MINGW or OLD_MINGW it is possible to build
kono
parents:
diff changeset
106 GNAT using both MingW include files (Old MingW + ACT changes and standard
kono
parents:
diff changeset
107 MingW starting with version 1.3.
kono
parents:
diff changeset
108 For w64 Mingw the define STD_MINGW is always set to value 1, because
kono
parents:
diff changeset
109 there is no old header set present. */
kono
parents:
diff changeset
110 #ifdef _WIN64
kono
parents:
diff changeset
111 #define STD_MINGW 1
kono
parents:
diff changeset
112 #else
kono
parents:
diff changeset
113 #define STD_MINGW ((__MINGW32_MAJOR_VERSION == 1 \
kono
parents:
diff changeset
114 && __MINGW32_MINOR_VERSION >= 3) \
kono
parents:
diff changeset
115 || (__MINGW32_MAJOR_VERSION >= 2))
kono
parents:
diff changeset
116 #endif
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 #define OLD_MINGW (!(STD_MINGW))
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 #ifndef MAXPATHLEN
kono
parents:
diff changeset
121 #define MAXPATHLEN MAX_PATH
kono
parents:
diff changeset
122 #endif
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 #endif /* _MINGW32_H */