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 /* These are defined by the user (or the compiler)
28 to specify how identifiers are imported from a DLL.
30 __DECLSPEC_SUPPORTED Defined if dllimport attribute is supported.
31 __MINGW_IMPORT The attribute definition to specify imported
33 _CRTIMP As above. For MS compatibility.
34 __MINGW32_VERSION Runtime version.
35 __MINGW32_MAJOR_VERSION Runtime major version.
36 __MINGW32_MINOR_VERSION Runtime minor version.
37 __MINGW32_BUILD_DATE Runtime build date.
41 __int64 define to be long long. Using a typedef doesn't
42 work for "unsigned __int64"
44 All headers should include this first, and then use __DECLSPEC_SUPPORTED
45 to choose between the old ``__imp__name'' style or __MINGW_IMPORT
46 style declarations. */
48 /* Try to avoid problems with outdated checks for GCC __attribute__ support. */
52 # ifndef __MINGW_IMPORT
53 # define __MINGW_IMPORT __declspec(dllimport)
56 # define _CRTIMP __declspec(dllimport)
58 # define __DECLSPEC_SUPPORTED
59 # define __attribute__(x) /* nothing */
62 # ifndef __MINGW_IMPORT
63 /* Note the extern. This is needed to work around GCC's
64 limitations in handling dllimport attribute. */
65 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
69 # define _CRTIMP __attribute__ ((dllimport))
74 # define __DECLSPEC_SUPPORTED
75 # else /* __declspec */
76 # undef __DECLSPEC_SUPPORTED
77 # undef __MINGW_IMPORT
81 # endif /* __declspec */
83 # define __cdecl __attribute__ ((__cdecl__))
86 # define __stdcall __attribute__ ((__stdcall__))
89 # define __int64 long long
95 # define __int16 short
101 # define __small char
104 # define __hyper long long
106 #endif /* __GNUC__ */
108 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
109 #define __MINGW_GNUC_PREREQ(major, minor) \
110 (__GNUC__ > (major) \
111 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
113 #define __MINGW_GNUC_PREREQ(major, minor) 0
117 # define __CRT_INLINE inline
119 # if __GNUC_STDC_INLINE__
120 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
122 # define __CRT_INLINE extern __inline__
127 # define __UNUSED_PARAM(x)
130 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
132 # define __UNUSED_PARAM(x) x
137 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
138 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
140 #define __MINGW_ATTRIB_NORETURN
141 #define __MINGW_ATTRIB_CONST
144 #if __MINGW_GNUC_PREREQ (3, 0)
145 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
146 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
148 #define __MINGW_ATTRIB_MALLOC
149 #define __MINGW_ATTRIB_PURE
152 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
153 variadiac macro facility, because variadic macros cause syntax
154 errors with --traditional-cpp. */
155 #if __MINGW_GNUC_PREREQ (3, 3)
156 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
158 #define __MINGW_ATTRIB_NONNULL(arg)
159 #endif /* GNUC >= 3.3 */
161 #if __MINGW_GNUC_PREREQ (3, 1)
162 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
164 #define __MINGW_ATTRIB_DEPRECATED
165 #endif /* GNUC >= 3.1 */
167 #ifndef __MSVCRT_VERSION__
168 /* High byte is the major version, low byte is the minor. */
169 # define __MSVCRT_VERSION__ 0x0600
172 #define __MINGW32_VERSION 3.12
173 #define __MINGW32_MAJOR_VERSION 3
174 #define __MINGW32_MINOR_VERSION 12
176 #endif /* __MINGW_H */