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
29 * Mingw specific macros.
32 #define __MINGW_VERSION 4.0
33 #define __MINGW_MAJOR_VERSION 4
34 #define __MINGW_MINOR_VERSION 0
35 #define __MINGW_PATCHLEVEL 0
37 // These four macros are deprecated and will be removed in the next major
39 #define __MINGW32_VERSION 3.20
40 #define __MINGW32_MAJOR_VERSION 3
41 #define __MINGW32_MINOR_VERSION 20
42 #define __MINGW32_PATCHLEVEL 0
45 #error ERROR: You must use a GNU Compiler.
48 #if (__GNUC__ < 3 || !defined(__GNUC_MINOR__) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4 && __GNUC_PATCHLEVEL__ < 5))
49 #error ERROR: You must use a GNU Compiler version >= 3.4.5.
52 /* These are defined by the user (or the compiler)
53 to specify how identifiers are imported from a DLL.
55 __MINGW_IMPORT The attribute definition to specify imported
57 _CRTIMP As above. For MS compatibility.
58 __MINGW_VERSION Runtime version.
59 __MINGW_MAJOR_VERSION Runtime major version.
60 __MINGW_MINOR_VERSION Runtime minor version.
61 __MINGW_BUILD_DATE Runtime build date.
63 Macros to enable MinGW features which deviate from standard MSVC
64 compatible behaviour; these may be specified directly in user code,
65 activated implicitly, (e.g. by specifying _POSIX_C_SOURCE or such),
66 or by inclusion in __MINGW_FEATURES__:
68 __USE_MINGW_ANSI_STDIO Select a more ANSI C99 compatible
69 implementation of printf() and friends.
73 __int64 define to be long long. Using a typedef
74 doesn't work for "unsigned __int64"
76 /* Manifest definitions identifying the flag bits, controlling activation
77 * of MinGW features, as specified by the user in __MINGW_FEATURES__.
79 #define __MINGW_ANSI_STDIO__ 0x0000000000000001ULL
81 * The following three are not yet formally supported; they are
82 * included here, to document anticipated future usage.
84 #define __MINGW_LC_EXTENSIONS__ 0x0000000000000050ULL
85 #define __MINGW_LC_MESSAGES__ 0x0000000000000010ULL
86 #define __MINGW_LC_ENVVARS__ 0x0000000000000040ULL
88 /* Try to avoid problems with outdated checks for GCC __attribute__ support. */
91 #ifndef __MINGW_IMPORT
92 /* Note the extern. This is needed to work around GCC's
93 limitations in handling dllimport attribute. */
94 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
98 # define _CRTIMP __attribute__ ((dllimport))
105 # define __int64 long long
108 # define __int32 long
111 # define __int16 short
117 # define __small char
120 # define __hyper long long
123 #define __MINGW_GNUC_PREREQ(major, minor) \
124 (__GNUC__ > (major) \
125 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
128 # define __CRT_INLINE inline
130 # if __GNUC_STDC_INLINE__
131 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
133 # define __CRT_INLINE extern __inline__
137 #define _CRTALIAS __CRT_INLINE __attribute__ ((__always_inline__))
140 # define __UNUSED_PARAM(x)
142 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
145 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
146 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
147 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
148 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
149 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
150 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
151 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
154 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
155 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
157 #ifndef __MSVCRT_VERSION__
158 /* High byte is the major version, low byte is the minor. */
159 # define __MSVCRT_VERSION__ 0x0600
162 /* Activation of MinGW specific extended features:
164 #ifndef __USE_MINGW_ANSI_STDIO
166 * If user didn't specify it explicitly...
168 # if defined __STRICT_ANSI__ || defined _ISOC99_SOURCE \
169 || defined _POSIX_SOURCE || defined _POSIX_C_SOURCE \
170 || defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED \
171 || defined _GNU_SOURCE || defined _BSD_SOURCE \
172 || defined _SVID_SOURCE
174 * but where any of these source code qualifiers are specified,
175 * then assume ANSI I/O standards are preferred over Microsoft's...
177 # define __USE_MINGW_ANSI_STDIO 1
180 * otherwise use whatever __MINGW_FEATURES__ specifies...
182 # define __USE_MINGW_ANSI_STDIO (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__)
186 struct threadlocalinfostruct;
187 struct threadmbinfostruct;
188 typedef struct threadlocalinfostruct *pthreadlocinfo;
189 typedef struct threadmbcinfostruct *pthreadmbcinfo;
191 typedef struct localeinfo_struct {
192 pthreadlocinfo locinfo;
193 pthreadmbcinfo mbcinfo;
194 } _locale_tstruct, *_locale_t;
196 /* The __AW() definition will be used for mapping UNICODE versus ASCII versions
197 * to the non represented names. This is accomplished by macro expansion of
198 * the symbol passed and concantenating either A or W to the symbol.
200 #define __AW__(AW, AW_) AW ## AW_
201 #if (defined(UNICODE) || defined(_UNICODE))
202 #define __AW(AW) __AW__(AW, W)
204 #define __AW(AW) __AW__(AW, A)
207 #endif /* __MINGW_H */