4 * Mingw specific macros included by ALL include files.
6 * This file is part of the Mingw32 package.
9 * Created by Mumit Khan <khan@xraylith.wisc.edu>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 #pragma GCC system_header
30 /* These are defined by the user (or the compiler)
31 to specify how identifiers are imported from a DLL.
33 __DECLSPEC_SUPPORTED Defined if dllimport attribute is supported.
34 __MINGW_IMPORT The attribute definition to specify imported
36 _CRTIMP As above. For MS compatibility.
37 __MINGW32_VERSION Runtime version.
38 __MINGW32_MAJOR_VERSION Runtime major version.
39 __MINGW32_MINOR_VERSION Runtime minor version.
40 __MINGW32_BUILD_DATE Runtime build date.
44 __int64 define to be long long. Using a typedef doesn't
45 work for "unsigned __int64"
47 All headers should include this first, and then use __DECLSPEC_SUPPORTED
48 to choose between the old ``__imp__name'' style or __MINGW_IMPORT
49 style declarations. */
51 /* Try to avoid problems with outdated checks for GCC __attribute__ support. */
55 # ifndef __MINGW_IMPORT
56 # define __MINGW_IMPORT __declspec(dllimport)
59 # define _CRTIMP __declspec(dllimport)
61 # define __DECLSPEC_SUPPORTED
62 # define __attribute__(x) /* nothing */
65 # ifndef __MINGW_IMPORT
66 /* Note the extern. This is needed to work around GCC's
67 limitations in handling dllimport attribute. */
68 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
72 # define _CRTIMP __attribute__ ((dllimport))
77 # define __DECLSPEC_SUPPORTED
78 # else /* __declspec */
79 # undef __DECLSPEC_SUPPORTED
80 # undef __MINGW_IMPORT
84 # endif /* __declspec */
86 # define __cdecl __attribute__ ((__cdecl__))
89 # define __stdcall __attribute__ ((__stdcall__))
92 # define __int64 long long
98 # define __int16 short
104 # define __small char
107 # define __hyper long long
109 #endif /* __GNUC__ */
111 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
112 #define __MINGW_GNUC_PREREQ(major, minor) \
113 (__GNUC__ > (major) \
114 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
116 #define __MINGW_GNUC_PREREQ(major, minor) 0
120 # define __CRT_INLINE inline
122 # if __GNUC_STDC_INLINE__
123 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
125 # define __CRT_INLINE extern __inline__
130 # define __UNUSED_PARAM(x)
133 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
135 # define __UNUSED_PARAM(x) x
140 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
141 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
143 #define __MINGW_ATTRIB_NORETURN
144 #define __MINGW_ATTRIB_CONST
147 #if __MINGW_GNUC_PREREQ (3, 0)
148 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
149 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
151 #define __MINGW_ATTRIB_MALLOC
152 #define __MINGW_ATTRIB_PURE
155 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
156 variadiac macro facility, because variadic macros cause syntax
157 errors with --traditional-cpp. */
158 #if __MINGW_GNUC_PREREQ (3, 3)
159 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
161 #define __MINGW_ATTRIB_NONNULL(arg)
162 #endif /* GNUC >= 3.3 */
164 #if __MINGW_GNUC_PREREQ (3, 1)
165 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
167 #define __MINGW_ATTRIB_DEPRECATED
168 #endif /* GNUC >= 3.1 */
170 #if __MINGW_GNUC_PREREQ (3, 3)
171 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
173 #define __MINGW_NOTHROW
174 #endif /* GNUC >= 3.3 */
176 #ifndef __MSVCRT_VERSION__
177 /* High byte is the major version, low byte is the minor. */
178 # define __MSVCRT_VERSION__ 0x0600
181 #ifndef _SIZE_T_DEFINED
182 #define _SIZE_T_DEFINED
185 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
186 typedef unsigned int size_t __attribute__ ((mode (DI
)));
188 typedef unsigned __int64
size_t;
191 typedef unsigned int size_t;
195 #define __MINGW32_VERSION 3.13
196 #define __MINGW32_MAJOR_VERSION 3
197 #define __MINGW32_MINOR_VERSION 13
199 #endif /* __MINGW_H */