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 #include <sdkddkver.h>
30 * Mingw specific macros.
33 #define __MINGW_VERSION 4.0
34 #define __MINGW_MAJOR_VERSION 4
35 #define __MINGW_MINOR_VERSION 0
36 #define __MINGW_PATCHLEVEL 0
38 // These four macros are deprecated and will be removed in the next major
40 #define __MINGW32_VERSION 3.20
41 #define __MINGW32_MAJOR_VERSION 3
42 #define __MINGW32_MINOR_VERSION 20
43 #define __MINGW32_PATCHLEVEL 0
46 #error ERROR: You must use a GNU Compiler.
49 #if (__GNUC__ < 3 || !defined(__GNUC_MINOR__) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4 && __GNUC_PATCHLEVEL__ < 5))
50 #error ERROR: You must use a GNU Compiler version >= 3.4.5.
53 /* These are defined by the user (or the compiler)
54 to specify how identifiers are imported from a DLL.
56 __MINGW_IMPORT The attribute definition to specify imported
58 _CRTIMP As above. For MS compatibility.
59 __MINGW_VERSION Runtime version.
60 __MINGW_MAJOR_VERSION Runtime major version.
61 __MINGW_MINOR_VERSION Runtime minor version.
62 __MINGW_BUILD_DATE Runtime build date.
64 Macros to enable MinGW features which deviate from standard MSVC
65 compatible behaviour; these may be specified directly in user code,
66 activated implicitly, (e.g. by specifying _POSIX_C_SOURCE or such),
67 or by inclusion in __MINGW_FEATURES__:
69 __USE_MINGW_ANSI_STDIO Select a more ANSI C99 compatible
70 implementation of printf() and friends.
74 __int64 define to be long long. Using a typedef
75 doesn't work for "unsigned __int64"
77 /* Manifest definitions identifying the flag bits, controlling activation
78 * of MinGW features, as specified by the user in __MINGW_FEATURES__.
80 #define __MINGW_ANSI_STDIO__ 0x0000000000000001ULL
82 * The following three are not yet formally supported; they are
83 * included here, to document anticipated future usage.
85 #define __MINGW_LC_EXTENSIONS__ 0x0000000000000050ULL
86 #define __MINGW_LC_MESSAGES__ 0x0000000000000010ULL
87 #define __MINGW_LC_ENVVARS__ 0x0000000000000040ULL
89 /* Try to avoid problems with outdated checks for GCC __attribute__ support. */
92 #ifndef __MINGW_IMPORT
93 /* Note the extern. This is needed to work around GCC's
94 limitations in handling dllimport attribute. */
95 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
99 # define _CRTIMP __attribute__ ((dllimport))
106 # define __int64 long long
109 # define __int32 long
112 # define __int16 short
118 # define __small char
121 # define __hyper long long
124 #define __MINGW_GNUC_PREREQ(major, minor) \
125 (__GNUC__ > (major) \
126 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
129 # define __CRT_INLINE inline
131 # if __GNUC_STDC_INLINE__
132 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
134 # define __CRT_INLINE extern __inline__
138 #define _CRTALIAS __CRT_INLINE __attribute__ ((__always_inline__))
141 # define __UNUSED_PARAM(x)
143 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
146 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
147 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
148 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
149 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
150 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
151 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
152 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
155 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
156 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
158 #ifndef __MSVCRT_VERSION__
159 /* High byte is the major version, low byte is the minor. */
160 # define __MSVCRT_VERSION__ 0x0600
163 /* Activation of MinGW specific extended features:
165 #ifndef __USE_MINGW_ANSI_STDIO
167 * If user didn't specify it explicitly...
169 # if defined __STRICT_ANSI__ || defined _ISOC99_SOURCE \
170 || defined _POSIX_SOURCE || defined _POSIX_C_SOURCE \
171 || defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED \
172 || defined _GNU_SOURCE || defined _BSD_SOURCE \
173 || defined _SVID_SOURCE
175 * but where any of these source code qualifiers are specified,
176 * then assume ANSI I/O standards are preferred over Microsoft's...
178 # define __USE_MINGW_ANSI_STDIO 1
181 * otherwise use whatever __MINGW_FEATURES__ specifies...
183 # define __USE_MINGW_ANSI_STDIO (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__)
187 struct threadlocalinfostruct;
188 struct threadmbinfostruct;
189 typedef struct threadlocalinfostruct *pthreadlocinfo;
190 typedef struct threadmbcinfostruct *pthreadmbcinfo;
192 typedef struct localeinfo_struct {
193 pthreadlocinfo locinfo;
194 pthreadmbcinfo mbcinfo;
195 } _locale_tstruct, *_locale_t;
197 /* The __AW() definition will be used for mapping UNICODE versus ASCII versions
198 * to the non represented names. This is accomplished by macro expansion of
199 * the symbol passed and concantenating either A or W to the symbol.
201 #define __AW__(AW, AW_) AW ## AW_
203 (!defined(__TEST_SQL_NOUNICODEMAP) && defined(UNICODE)) || \
204 (!defined(__TEST_SQL_NOUNICODEMAP) && defined(_UNICODE)) || \
205 defined(FORCE_UNICODE) || \
206 (defined(__TEST_SQL_NOUNICODEMAP) && !defined(SQL_NOUNICODEMAP) && (defined(UNICODE) || defined(_UNICODE))) \
208 #define __AW(AW) __AW__(AW, W)
209 #define __STR(AW) __AW__(L, AW)
211 #define __AW(AW) __AW__(AW, A)
212 #define __STR(AW) __AW__(, AW)
215 #endif /* __MINGW_H */