5 * Mingw specific macros included by ALL include files.
7 * This file is part of the Mingw32 package.
10 * Created by Mumit Khan <khan@xraylith.wisc.edu>
12 * THIS SOFTWARE IS NOT COPYRIGHTED
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 #define __MINGW_VERSION 4.0
26 #define __MINGW_MAJOR_VERSION 4
27 #define __MINGW_MINOR_VERSION 0
28 #define __MINGW_PATCHLEVEL 0
30 // These four macros are deprecated and will be removed in the next major
32 #define __MINGW32_VERSION 3.20
33 #define __MINGW32_MAJOR_VERSION 3
34 #define __MINGW32_MINOR_VERSION 20
35 #define __MINGW32_PATCHLEVEL 0
37 #pragma GCC system_header
40 #error ERROR: You must use a GNU Compiler.
43 #if (__GNUC__ < 3 || !defined(__GNUC__MINOR__) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4 && __GNUC_PATCHLEVEL__ < 5))
44 #error ERROR: You must use a GNU Compiler version >= 3.4.5.
47 /* These are defined by the user (or the compiler)
48 to specify how identifiers are imported from a DLL.
50 __DECLSPEC_SUPPORTED Defined if dllimport attribute is supported.
51 __MINGW_IMPORT The attribute definition to specify imported
53 _CRTIMP As above. For MS compatibility.
54 __MINGW_VERSION Runtime version.
55 __MINGW_MAJOR_VERSION Runtime major version.
56 __MINGW_MINOR_VERSION Runtime minor version.
57 __MINGW_BUILD_DATE Runtime build date.
59 Macros to enable MinGW features which deviate from standard MSVC
60 compatible behaviour; these may be specified directly in user code,
61 activated implicitly, (e.g. by specifying _POSIX_C_SOURCE or such),
62 or by inclusion in __MINGW_FEATURES__:
64 __USE_MINGW_ANSI_STDIO Select a more ANSI C99 compatible
65 implementation of printf() and friends.
69 __int64 define to be long long. Using a typedef
70 doesn't work for "unsigned __int64"
72 All headers should include this first, and then use __DECLSPEC_SUPPORTED
73 to choose between the old ``__imp__name'' style or __MINGW_IMPORT
74 style declarations. */
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. */
93 # ifndef __MINGW_IMPORT
94 /* Note the extern. This is needed to work around GCC's
95 limitations in handling dllimport attribute. */
96 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
100 # define _CRTIMP __attribute__ ((dllimport))
105 # define __DECLSPEC_SUPPORTED
106 #else /* __declspec */
107 # undef __DECLSPEC_SUPPORTED
108 # undef __MINGW_IMPORT
112 #endif /* __declspec */
114 * The next two defines can cause problems if user code adds the
115 * __cdecl attribute like so:
116 * void __attribute__ ((__cdecl)) foo(void);
119 # define __cdecl __attribute__ ((__cdecl__))
122 # define __stdcall __attribute__ ((__stdcall__))
125 # define __int64 long long
128 # define __int32 long
131 # define __int16 short
137 # define __small char
140 # define __hyper long long
143 #define __MINGW_GNUC_PREREQ(major, minor) \
144 (__GNUC__ > (major) \
145 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
148 # define __CRT_INLINE inline
150 # if __GNUC_STDC_INLINE__
151 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
153 # define __CRT_INLINE extern __inline__
157 #define _CRTALIAS __CRT_INLINE __attribute__ ((__always_inline__))
160 # define __UNUSED_PARAM(x)
162 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
165 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
166 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
167 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
168 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
169 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
170 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
171 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
174 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
175 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
177 #ifndef __MSVCRT_VERSION__
178 /* High byte is the major version, low byte is the minor. */
179 # define __MSVCRT_VERSION__ 0x0600
182 /* Activation of MinGW specific extended features:
184 #ifndef __USE_MINGW_ANSI_STDIO
186 * If user didn't specify it explicitly...
188 # if defined __STRICT_ANSI__ || defined _ISOC99_SOURCE \
189 || defined _POSIX_SOURCE || defined _POSIX_C_SOURCE \
190 || defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED \
191 || defined _GNU_SOURCE || defined _BSD_SOURCE \
192 || defined _SVID_SOURCE
194 * but where any of these source code qualifiers are specified,
195 * then assume ANSI I/O standards are preferred over Microsoft's...
197 # define __USE_MINGW_ANSI_STDIO 1
200 * otherwise use whatever __MINGW_FEATURES__ specifies...
202 # define __USE_MINGW_ANSI_STDIO (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__)
206 struct threadlocalinfostruct;
207 struct threadmbinfostruct;
208 typedef struct threadlocalinfostruct *pthreadlocinfo;
209 typedef struct threadmbcinfostruct *pthreadmbcinfo;
211 typedef struct localeinfo_struct {
212 pthreadlocinfo locinfo;
213 pthreadmbcinfo mbcinfo;
214 } _locale_tstruct, *_locale_t;
216 #endif /* __MINGW_H */