ReactOS  0.4.15-dev-1207-g698a8e6
_mingw.h
Go to the documentation of this file.
1 
7 #ifndef _INC_MINGW
8 #define _INC_MINGW
9 
10 #ifndef _INTEGRAL_MAX_BITS
11 #define _INTEGRAL_MAX_BITS 64
12 #endif
13 
14 #ifndef MINGW64
15 #define MINGW64
16 #define MINGW64_VERSION 1.0
17 #define MINGW64_VERSION_MAJOR 1
18 #define MINGW64_VERSION_MINOR 0
19 #define MINGW64_VERSION_STATE "alpha"
20 #endif
21 
22 #ifdef _WIN64
23 #ifdef __stdcall
24 #undef __stdcall
25 #endif
26 #define __stdcall
27 #endif
28 
29 #ifdef __GNUC__
30  /* These compilers do support __declspec */
31 # if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__CYGWIN32__)
32 # define __declspec(x) __attribute__((x))
33 # endif
34 #endif
35 
36 #ifdef _MSC_VER
37 #define __restrict__ /* nothing */
38 #endif
39 
40 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
41 #define __MINGW_GNUC_PREREQ(major, minor) \
42  (__GNUC__ > (major) \
43  || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
44 #else
45 #define __MINGW_GNUC_PREREQ(major, minor) 0
46 #endif
47 
48 #if defined (_MSC_VER)
49 #define __MINGW_MSC_PREREQ(major, minor) (_MSC_VER >= (major * 100 + minor * 10))
50 #else
51 #define __MINGW_MSC_PREREQ(major, minor) 0
52 #endif
53 
54 #define USE___UUIDOF 0
55 
56 #ifdef __cplusplus
57 # define __CRT_INLINE inline
58 #elif defined(_MSC_VER)
59 # define __CRT_INLINE __inline
60 #elif defined(__GNUC__)
61 # if defined(__clang__) || ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
62 # define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
63 # else
64 # define __CRT_INLINE extern __inline__ __attribute__((__always_inline__))
65 # endif
66 #endif
67 
68 #ifdef __cplusplus
69 # define __UNUSED_PARAM(x)
70 #else
71 # ifdef __GNUC__
72 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
73 # else
74 # define __UNUSED_PARAM(x) x
75 # endif
76 #endif
77 
78 #ifdef __cplusplus
79 # define __unaligned
80 #else
81 # ifdef __GNUC__
82 # define __unaligned
83 # elif defined(_MSC_VER) && !defined(_M_IA64) && !defined(_M_AMD64)
84 # define __unaligned
85 # else
86 # define __unaligned
87 # endif
88 #endif
89 
90 #ifdef __GNUC__
91 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
92 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
93 #elif __MINGW_MSC_PREREQ(12, 0)
94 #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
95 #define __MINGW_ATTRIB_CONST
96 #else
97 #define __MINGW_ATTRIB_NORETURN
98 #define __MINGW_ATTRIB_CONST
99 #endif
100 
101 #if __MINGW_GNUC_PREREQ (3, 0)
102 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
103 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
104 #elif __MINGW_MSC_PREREQ(14, 0)
105 #define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
106 #define __MINGW_ATTRIB_PURE
107 #else
108 #define __MINGW_ATTRIB_MALLOC
109 #define __MINGW_ATTRIB_PURE
110 #endif
111 
112 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
113  variadiac macro facility, because variadic macros cause syntax
114  errors with --traditional-cpp. */
115 #if __MINGW_GNUC_PREREQ (3, 3)
116 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
117 #else
118 #define __MINGW_ATTRIB_NONNULL(arg)
119 #endif /* GNUC >= 3.3 */
120 
121 #ifdef __GNUC__
122 #define __MINGW_ATTRIB_UNUSED __attribute__ ((__unused__))
123 #else
124 #define __MINGW_ATTRIB_UNUSED
125 #endif /* ATTRIBUTE_UNUSED */
126 
127 #if __MINGW_GNUC_PREREQ (3, 1)
128 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
129 #elif __MINGW_MSC_PREREQ(12, 0)
130 #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
131 #else
132 #define __MINGW_ATTRIB_DEPRECATED
133 #endif
134 
135 #if __MINGW_GNUC_PREREQ (3, 1)
136 #define __MINGW_ATTRIB_DEPRECATED_SEC_WARN //__attribute__ ((__deprecated__))
137 #elif __MINGW_MSC_PREREQ(12, 0)
138 #define __MINGW_ATTRIB_DEPRECATED_SEC_WARN //__declspec(deprecated)
139 #else
140 #define __MINGW_ATTRIB_DEPRECATED_SEC_WARN
141 #endif
142 
143 #if __MINGW_GNUC_PREREQ (3, 1)
144 #define __MINGW_ATTRIB_DEPRECATED_MSVC2005 //__attribute__ ((__deprecated__))
145 #elif __MINGW_MSC_PREREQ(12, 0)
146 #define __MINGW_ATTRIB_DEPRECATED_MSVC2005 //__declspec(deprecated)
147 #else
148 #define __MINGW_ATTRIB_DEPRECATED_MSVC2005
149 #endif
150 
151 #if __MINGW_GNUC_PREREQ (3, 3)
152 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
153 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
154 #define __MINGW_NOTHROW __declspec(nothrow)
155 #else
156 #define __MINGW_NOTHROW
157 #endif
158 
159 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
160 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
161 
162 #ifndef __MINGW_EXTENSION
163 #if defined(__GNUC__) || defined(__GNUG__)
164 #define __MINGW_EXTENSION __extension__
165 #else
166 #define __MINGW_EXTENSION
167 #endif
168 #endif
169 
170 #ifndef __MSVCRT_VERSION__
171 /* High byte is the major version, low byte is the minor. */
172 # define __MSVCRT_VERSION__ 0x0700
173 #endif
174 
175 //#ifndef WINVER
176 //#define WINVER 0x0502
177 //#endif
178 
179 //#ifndef _WIN32_WINNT
180 //#define _WIN32_WINNT 0x502
181 //#endif
182 
183 #ifdef __GNUC__
184 #define __int8 char
185 #define __int16 short
186 #define __int32 int
187 #define __int64 long long
188 #ifdef _WIN64
189  typedef int __int128 __attribute__ ((mode (TI)));
190 # endif
191 # define __ptr32
192 # define __ptr64
193 # ifdef __cplusplus
194 # define __forceinline inline __attribute__((__always_inline__))
195 # else
196 # if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
197 # define __forceinline extern inline __attribute__((__always_inline__,__gnu_inline__))
198 # else
199 # define __forceinline extern __inline__ __attribute__((__always_inline__))
200 # endif
201 # endif
202 #endif
203 
204 #ifdef __cplusplus
205 #ifndef __nothrow
206 #define __nothrow __declspec(nothrow)
207 #endif
208 #else
209 #ifndef __nothrow
210 #define __nothrow
211 #endif
212 #endif
213 
214 #if defined(_WIN64) && !defined(_MSC_VER)
215 #undef USE_MINGW_SETJMP_TWO_ARGS
216 #define USE_MINGW_SETJMP_TWO_ARGS
217 #endif
218 
219 /* Disable deprecation for now! */
220 #define _CRT_SECURE_NO_DEPRECATE
221 #define _CRT_SECURE_NO_DEPRECATE_CORE
222 #ifdef __WINESRC__
223 #define _CRT_NONSTDC_NO_DEPRECATE
224 #endif
225 
226 #define __crt_typefix(ctype)
227 
228 #ifndef _CRT_UNUSED
229 #define _CRT_UNUSED(x) (void)x
230 #endif
231 
232 #if defined(_MSC_VER) && !defined(__clang__)
233 #define ATTRIB_NORETURN
234 #define _DECLSPEC_INTRIN_TYPE __declspec(intrin_type)
235 #else
236 #define ATTRIB_NORETURN DECLSPEC_NORETURN
237 #define _DECLSPEC_INTRIN_TYPE
238 #endif
239 
240 /* Define to a function attribute for Microsoft hotpatch assembly prefix. */
241 #ifndef DECLSPEC_HOTPATCH
242 #if defined(_MSC_VER) || defined(__clang__)
243 /* FIXME: http://llvm.org/bugs/show_bug.cgi?id=20888 */
244 #define DECLSPEC_HOTPATCH
245 #else
246 #define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))
247 #endif
248 #endif /* DECLSPEC_HOTPATCH */
249 
250 #ifdef __cplusplus
251 # define __mingw_ovr inline __cdecl
252 #elif defined (__GNUC__)
253 # define __mingw_ovr static \
254  __attribute__ ((__unused__)) __inline__ __cdecl
255 #else
256 # define __mingw_ovr static __cdecl
257 #endif /* __cplusplus */
258 
259 #include "_mingw_mac.h"
260 
261 #endif /* !_INC_MINGW */
262 
#define __attribute__(x)
Definition: wpp_private.h:207
GLenum mode
Definition: glext.h:6217