1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 7 #ifndef _INC_CRTDEFS_MACRO 8 #define _INC_CRTDEFS_MACRO 9 10 #define __STRINGIFY(x) #x 11 #define __MINGW64_STRINGIFY(x) \ 12 __STRINGIFY(x) 13 14 #define __MINGW64_VERSION_MAJOR 7 15 #define __MINGW64_VERSION_MINOR 0 16 #define __MINGW64_VERSION_BUGFIX 0 17 18 /* This macro holds an monotonic increasing value, which indicates 19 a specific fix/patch is present on trunk. This value isn't related to 20 minor/major version-macros. It is increased on demand, if a big 21 fix was applied to trunk. This macro gets just increased on trunk. For 22 other branches its value won't be modified. */ 23 24 #define __MINGW64_VERSION_RC 0 25 26 #define __MINGW64_VERSION_STR \ 27 __MINGW64_STRINGIFY(__MINGW64_VERSION_MAJOR) \ 28 "." \ 29 __MINGW64_STRINGIFY(__MINGW64_VERSION_MINOR) \ 30 "." \ 31 __MINGW64_STRINGIFY(__MINGW64_VERSION_BUGFIX) 32 33 #define __MINGW64_VERSION_STATE "alpha" 34 35 /* mingw.org's version macros: these make gcc to define 36 MINGW32_SUPPORTS_MT_EH and to use the _CRT_MT global 37 and the __mingwthr_key_dtor() function from the MinGW 38 CRT in its private gthr-win32.h header. */ 39 #define __MINGW32_MAJOR_VERSION 3 40 #define __MINGW32_MINOR_VERSION 11 41 42 /* Set VC specific compiler target macros. */ 43 #if defined(__x86_64) && defined(_X86_) 44 # undef _X86_ /* _X86_ is not for __x86_64 */ 45 #endif 46 47 #if defined(_X86_) && !defined(_M_IX86) && !defined(_M_IA64) \ 48 && !defined(_M_AMD64) && !defined(__x86_64) 49 # if defined(__i486__) 50 # define _M_IX86 400 51 # elif defined(__i586__) 52 # define _M_IX86 500 53 # elif defined(__i686__) 54 # define _M_IX86 600 55 # else 56 # define _M_IX86 300 57 # endif 58 #endif /* if defined(_X86_) && !defined(_M_IX86) && !defined(_M_IA64) ... */ 59 60 #if defined(__x86_64) && !defined(_M_IX86) && !defined(_M_IA64) \ 61 && !defined(_M_AMD64) 62 # define _M_AMD64 100 63 # define _M_X64 100 64 #endif 65 66 #if defined(__ia64__) && !defined(_M_IX86) && !defined(_M_IA64) \ 67 && !defined(_M_AMD64) && !defined(_X86_) && !defined(__x86_64) 68 # define _M_IA64 100 69 #endif 70 71 #if defined(__arm__) && !defined(_M_ARM) && !defined(_M_ARMT) \ 72 && !defined(_M_THUMB) 73 # define _M_ARM 100 74 # define _M_ARMT 100 75 # define _M_THUMB 100 76 # ifndef _ARM_ 77 # define _ARM_ 1 78 # endif 79 # ifndef _M_ARM_NT 80 # define _M_ARM_NT 1 81 # endif 82 #endif 83 84 #if defined(__aarch64__) && !defined(_M_ARM64) 85 # define _M_ARM64 1 86 # ifndef _ARM64_ 87 # define _ARM64_ 1 88 # endif 89 #endif 90 91 #ifndef _X86_ 92 /* MS does not prefix symbols by underscores for 64-bit. */ 93 # ifndef __MINGW_USE_UNDERSCORE_PREFIX 94 /* As we have to support older gcc version, which are using underscores 95 as symbol prefix for x64, we have to check here for the user label 96 prefix defined by gcc. */ 97 # ifdef __USER_LABEL_PREFIX__ 98 # pragma push_macro ("_") 99 # undef _ 100 # define _ 1 101 # if (__USER_LABEL_PREFIX__ + 0) != 0 102 # define __MINGW_USE_UNDERSCORE_PREFIX 1 103 # else 104 # define __MINGW_USE_UNDERSCORE_PREFIX 0 105 # endif 106 # undef _ 107 # pragma pop_macro ("_") 108 # else /* ! __USER_LABEL_PREFIX__ */ 109 # define __MINGW_USE_UNDERSCORE_PREFIX 0 110 # endif /* __USER_LABEL_PREFIX__ */ 111 # endif 112 #else /* ! ifndef _X86_ */ 113 /* For x86 we have always to prefix by underscore. */ 114 # undef __MINGW_USE_UNDERSCORE_PREFIX 115 # define __MINGW_USE_UNDERSCORE_PREFIX 1 116 #endif /* ifndef _X86_ */ 117 118 #if __MINGW_USE_UNDERSCORE_PREFIX == 0 119 # define __MINGW_IMP_SYMBOL(sym) __imp_##sym 120 # define __MINGW_IMP_LSYMBOL(sym) __imp_##sym 121 # define __MINGW_USYMBOL(sym) sym 122 # define __MINGW_LSYMBOL(sym) _##sym 123 #else /* ! if __MINGW_USE_UNDERSCORE_PREFIX == 0 */ 124 # define __MINGW_IMP_SYMBOL(sym) _imp__##sym 125 # define __MINGW_IMP_LSYMBOL(sym) __imp__##sym 126 # define __MINGW_USYMBOL(sym) _##sym 127 # define __MINGW_LSYMBOL(sym) sym 128 #endif /* if __MINGW_USE_UNDERSCORE_PREFIX == 0 */ 129 130 #ifndef __PTRDIFF_TYPE__ 131 # ifdef _WIN64 132 # define __PTRDIFF_TYPE__ long long int 133 # else 134 # define __PTRDIFF_TYPE__ long int 135 # endif 136 #endif 137 138 #ifndef __SIZE_TYPE__ 139 # ifdef _WIN64 140 # define __SIZE_TYPE__ long long unsigned int 141 # else 142 # define __SIZE_TYPE__ long unsigned int 143 # endif 144 #endif 145 146 #ifndef __WCHAR_TYPE__ 147 # define __WCHAR_TYPE__ unsigned short 148 #endif 149 150 #ifndef __WINT_TYPE__ 151 # define __WINT_TYPE__ unsigned short 152 #endif 153 154 #undef __MINGW_EXTENSION 155 156 #ifdef __WIDL__ 157 # define __MINGW_EXTENSION 158 #else 159 # if defined(__GNUC__) || defined(__GNUG__) 160 # define __MINGW_EXTENSION __extension__ 161 # else 162 # define __MINGW_EXTENSION 163 # endif 164 #endif /* __WIDL__ */ 165 166 /* Special case nameless struct/union. */ 167 #ifndef __C89_NAMELESS 168 # define __C89_NAMELESS __MINGW_EXTENSION 169 # define __C89_NAMELESSSTRUCTNAME 170 # define __C89_NAMELESSSTRUCTNAME1 171 # define __C89_NAMELESSSTRUCTNAME2 172 # define __C89_NAMELESSSTRUCTNAME3 173 # define __C89_NAMELESSSTRUCTNAME4 174 # define __C89_NAMELESSSTRUCTNAME5 175 # define __C89_NAMELESSUNIONNAME 176 # define __C89_NAMELESSUNIONNAME1 177 # define __C89_NAMELESSUNIONNAME2 178 # define __C89_NAMELESSUNIONNAME3 179 # define __C89_NAMELESSUNIONNAME4 180 # define __C89_NAMELESSUNIONNAME5 181 # define __C89_NAMELESSUNIONNAME6 182 # define __C89_NAMELESSUNIONNAME7 183 # define __C89_NAMELESSUNIONNAME8 184 #endif 185 186 #ifndef __GNU_EXTENSION 187 # define __GNU_EXTENSION __MINGW_EXTENSION 188 #endif 189 190 /* MinGW-w64 has some additional C99 printf/scanf feature support. 191 So we add some helper macros to ease recognition of them. */ 192 #define __MINGW_HAVE_ANSI_C99_PRINTF 1 193 #define __MINGW_HAVE_WIDE_C99_PRINTF 1 194 #define __MINGW_HAVE_ANSI_C99_SCANF 1 195 #define __MINGW_HAVE_WIDE_C99_SCANF 1 196 197 #ifdef __MINGW_USE_BROKEN_INTERFACE 198 # define __MINGW_POISON_NAME(__IFACE) __IFACE 199 #else 200 # define __MINGW_POISON_NAME(__IFACE) \ 201 __IFACE##_layout_has_not_been_verified_and_its_declaration_is_most_likely_incorrect 202 #endif 203 204 #ifndef __MSABI_LONG 205 # ifndef __LP64__ 206 # define __MSABI_LONG(x) x ## l 207 # else 208 # define __MSABI_LONG(x) x 209 # endif 210 #endif 211 212 #if __GNUC__ 213 # define __MINGW_GCC_VERSION (__GNUC__ * 10000 + \ 214 __GNUC_MINOR__ * 100 + \ 215 __GNUC_PATCHLEVEL__) 216 #else 217 # define __MINGW_GCC_VERSION 0 218 #endif 219 220 #if defined (__GNUC__) && defined (__GNUC_MINOR__) 221 # define __MINGW_GNUC_PREREQ(major, minor) \ 222 (__GNUC__ > (major) \ 223 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) 224 #else 225 # define __MINGW_GNUC_PREREQ(major, minor) 0 226 #endif 227 228 #if defined (_MSC_VER) 229 # define __MINGW_MSC_PREREQ(major, minor) \ 230 (_MSC_VER >= (major * 100 + minor * 10)) 231 #else 232 # define __MINGW_MSC_PREREQ(major, minor) 0 233 #endif 234 235 #ifdef __MINGW_MSVC_COMPAT_WARNINGS 236 # if __MINGW_GNUC_PREREQ (4, 5) 237 # define __MINGW_ATTRIB_DEPRECATED_STR(X) \ 238 __attribute__ ((__deprecated__ (X))) 239 # else 240 # define __MINGW_ATTRIB_DEPRECATED_STR(X) \ 241 __MINGW_ATTRIB_DEPRECATED 242 # endif 243 #else 244 # define __MINGW_ATTRIB_DEPRECATED_STR(X) 245 #endif /* ifdef __MINGW_MSVC_COMPAT_WARNINGS */ 246 247 #define __MINGW_SEC_WARN_STR \ 248 "This function or variable may be unsafe, use _CRT_SECURE_NO_WARNINGS to disable deprecation" 249 250 #define __MINGW_MSVC2005_DEPREC_STR \ 251 "This POSIX function is deprecated beginning in Visual C++ 2005, use _CRT_NONSTDC_NO_DEPRECATE to disable deprecation" 252 253 #if !defined (_CRT_NONSTDC_NO_DEPRECATE) 254 # define __MINGW_ATTRIB_DEPRECATED_MSVC2005 \ 255 __MINGW_ATTRIB_DEPRECATED_STR(__MINGW_MSVC2005_DEPREC_STR) 256 #else 257 # define __MINGW_ATTRIB_DEPRECATED_MSVC2005 258 #endif 259 260 #if !defined (_CRT_SECURE_NO_WARNINGS) || (_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES == 0) 261 # define __MINGW_ATTRIB_DEPRECATED_SEC_WARN \ 262 __MINGW_ATTRIB_DEPRECATED_STR(__MINGW_SEC_WARN_STR) 263 #else 264 # define __MINGW_ATTRIB_DEPRECATED_SEC_WARN 265 #endif 266 267 #define __MINGW_MS_PRINTF(__format,__args) \ 268 __attribute__((__format__(ms_printf, __format,__args))) 269 270 #define __MINGW_MS_SCANF(__format,__args) \ 271 __attribute__((__format__(ms_scanf, __format,__args))) 272 273 #define __MINGW_GNU_PRINTF(__format,__args) \ 274 __attribute__((__format__(gnu_printf,__format,__args))) 275 276 #define __MINGW_GNU_SCANF(__format,__args) \ 277 __attribute__((__format__(gnu_scanf, __format,__args))) 278 279 #undef __mingw_ovr 280 #undef __mingw_static_ovr 281 282 #ifdef __cplusplus 283 # define __mingw_ovr inline __cdecl 284 # define __mingw_static_ovr static __mingw_ovr 285 #elif defined (__GNUC__) 286 # define __mingw_ovr static \ 287 __attribute__ ((__unused__)) __inline__ __cdecl 288 # define __mingw_static_ovr __mingw_ovr 289 #else 290 # define __mingw_ovr static __cdecl 291 # define __mingw_static_ovr __mingw_ovr 292 #endif /* __cplusplus */ 293 294 /* Enable workaround for ABI incompatibility on affected platforms */ 295 #ifndef WIDL_EXPLICIT_AGGREGATE_RETURNS 296 #if defined(__GNUC__) && defined(__cplusplus) && (defined(__x86_64__) || defined(__i386__)) 297 #define WIDL_EXPLICIT_AGGREGATE_RETURNS 298 #endif 299 #endif 300 301 #endif /* _INC_CRTDEFS_MACRO */ 302