ReactOS  0.4.14-dev-854-gb9426a3
_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 # if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
194 # define __forceinline extern inline __attribute__((__always_inline__,__gnu_inline__))
195 # else
196 # define __forceinline extern __inline__ __attribute__((__always_inline__))
197 # endif
198 #endif
199 
200 #ifdef __cplusplus
201 #ifndef __nothrow
202 #define __nothrow __declspec(nothrow)
203 #endif
204 #else
205 #ifndef __nothrow
206 #define __nothrow
207 #endif
208 #endif
209 
210 #if defined(_WIN64) && !defined(_MSC_VER)
211 #undef USE_MINGW_SETJMP_TWO_ARGS
212 #define USE_MINGW_SETJMP_TWO_ARGS
213 #endif
214 
215 /* Disable deprecation for now! */
216 #define _CRT_SECURE_NO_DEPRECATE
217 #define _CRT_SECURE_NO_DEPRECATE_CORE
218 #ifdef __WINESRC__
219 #define _CRT_NONSTDC_NO_DEPRECATE
220 #endif
221 
222 #define __crt_typefix(ctype)
223 
224 #ifndef _CRT_UNUSED
225 #define _CRT_UNUSED(x) (void)x
226 #endif
227 
228 #if defined(_MSC_VER) && !defined(__clang__)
229 #define ATTRIB_NORETURN
230 #define _DECLSPEC_INTRIN_TYPE __declspec(intrin_type)
231 #else
232 #define ATTRIB_NORETURN DECLSPEC_NORETURN
233 #define _DECLSPEC_INTRIN_TYPE
234 #endif
235 
236 /* Define to a function attribute for Microsoft hotpatch assembly prefix. */
237 #ifndef DECLSPEC_HOTPATCH
238 #if defined(_MSC_VER) || defined(__clang__)
239 /* FIXME: http://llvm.org/bugs/show_bug.cgi?id=20888 */
240 #define DECLSPEC_HOTPATCH
241 #else
242 #define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))
243 #endif
244 #endif /* DECLSPEC_HOTPATCH */
245 
246 #ifdef __cplusplus
247 # define __mingw_ovr inline __cdecl
248 #elif defined (__GNUC__)
249 # define __mingw_ovr static \
250  __attribute__ ((__unused__)) __inline__ __cdecl
251 #else
252 # define __mingw_ovr static __cdecl
253 #endif /* __cplusplus */
254 
255 #include "_mingw_mac.h"
256 
257 #endif /* !_INC_MINGW */
258 
#define __attribute__(x)
Definition: wpp_private.h:207
GLenum mode
Definition: glext.h:6217