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