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__MINGW_H
      8 #define _INC__MINGW_H
      9 
     10 #define MINGW_HAS_SECURE_API 1
     11 
     12 #include "_mingw_mac.h"
     13 #include "_mingw_secapi.h"
     14 
     15 /* Include _cygwin.h if we're building a Cygwin application. */
     16 #ifdef __CYGWIN__
     17 #include "_cygwin.h"
     18 #endif
     19 
     20 /* Target specific macro replacement for type "long".  In the Windows API,
     21    the type long is always 32 bit, even if the target is 64 bit (LLP64).
     22    On 64 bit Cygwin, the type long is 64 bit (LP64).  So, to get the right
     23    sized definitions and declarations, all usage of type long in the Windows
     24    headers have to be replaced by the below defined macro __LONG32. */
     25 #ifndef __LP64__	/* 32 bit target, 64 bit Mingw target */
     26 #define __LONG32 long
     27 #else			/* 64 bit Cygwin target */
     28 #define __LONG32 int
     29 #endif
     30 
     31 /* C/C++ specific language defines.  */
     32 #ifdef _WIN64
     33 #ifdef __stdcall
     34 #undef __stdcall
     35 #endif
     36 #define __stdcall
     37 #endif
     38 
     39 #ifndef __GNUC__
     40 # ifndef __MINGW_IMPORT
     41 #  define __MINGW_IMPORT  __declspec(dllimport)
     42 # endif
     43 # ifndef _CRTIMP
     44 #  define _CRTIMP  __declspec(dllimport)
     45 # endif
     46 # define __DECLSPEC_SUPPORTED
     47 # define __attribute__(x) /* nothing */
     48 #else /* __GNUC__ */
     49 # ifdef __declspec
     50 #  ifndef __MINGW_IMPORT
     51 /* Note the extern. This is needed to work around GCC's
     52 limitations in handling dllimport attribute.  */
     53 #   define __MINGW_IMPORT  extern __attribute__ ((__dllimport__))
     54 #  endif
     55 #  ifndef _CRTIMP
     56 #    undef __USE_CRTIMP
     57 #    if !defined (_CRTBLD) && !defined (_SYSCRT)
     58 #      define __USE_CRTIMP 1
     59 #    endif
     60 #    ifdef __USE_CRTIMP
     61 #      define _CRTIMP  __attribute__ ((__dllimport__))
     62 #    else
     63 #      define _CRTIMP
     64 #    endif
     65 #  endif
     66 #  define __DECLSPEC_SUPPORTED
     67 # else /* __declspec */
     68 #  undef __DECLSPEC_SUPPORTED
     69 #  undef __MINGW_IMPORT
     70 #  ifndef _CRTIMP
     71 #   define _CRTIMP
     72 #  endif
     73 # endif /* __declspec */
     74 #endif /* __GNUC__ */
     75 
     76 #ifdef _MSC_VER
     77 #define USE___UUIDOF	1
     78 #else
     79 #define USE___UUIDOF	0
     80 #endif
     81 
     82 #if !defined(_MSC_VER) && !defined(_inline)
     83 #define _inline __inline
     84 #endif
     85 
     86 #ifdef __cplusplus
     87 # define __CRT_INLINE inline
     88 #elif defined(_MSC_VER)
     89 # define __CRT_INLINE __inline
     90 #else
     91 # if ( __MINGW_GNUC_PREREQ(4, 3)  &&  __STDC_VERSION__ >= 199901L) \
     92      || (defined (__clang__))
     93 #  define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
     94 # else
     95 #  define __CRT_INLINE extern __inline__
     96 # endif
     97 #endif
     98 
     99 #if !defined(__MINGW_INTRIN_INLINE) && defined(__GNUC__)
    100 #define __MINGW_INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
    101 #endif
    102 
    103 #ifndef __CYGWIN__
    104 #ifdef __NO_INLINE__
    105 #undef __CRT__NO_INLINE
    106 #define __CRT__NO_INLINE 1
    107 #endif
    108 #endif
    109 
    110 #ifdef __cplusplus
    111 # define __UNUSED_PARAM(x)
    112 #else
    113 # ifdef __GNUC__
    114 #  define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
    115 # else
    116 #  define __UNUSED_PARAM(x) x
    117 # endif
    118 #endif
    119 
    120 #ifndef __GNUC__
    121 # ifdef _MSC_VER
    122 #  define __restrict__  __restrict
    123 # else
    124 #  define __restrict__	/* nothing */
    125 # endif
    126 #endif /* !__GNUC__ */
    127 
    128 #if __MINGW_GNUC_PREREQ (3,1) && !defined __GNUG__
    129 # define __restrict_arr __restrict
    130 #elif defined(_MSC_VER)
    131 # define __restrict_arr __restrict
    132 #else
    133 # ifdef __GNUC__
    134 #  define __restrict_arr        /* Not supported in old GCC.  */
    135 # else
    136 #  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
    137 #   define __restrict_arr       restrict
    138 #  else
    139 #   define __restrict_arr       /* Not supported.  */
    140 #  endif
    141 # endif
    142 #endif
    143 
    144 #ifdef __GNUC__
    145 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
    146 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
    147 #elif __MINGW_MSC_PREREQ(12, 0)
    148 #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
    149 #define __MINGW_ATTRIB_CONST
    150 #else
    151 #define __MINGW_ATTRIB_NORETURN
    152 #define __MINGW_ATTRIB_CONST
    153 #endif
    154 
    155 #if __MINGW_GNUC_PREREQ (3, 0)
    156 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
    157 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
    158 #elif __MINGW_MSC_PREREQ(14, 0)
    159 #define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
    160 #define __MINGW_ATTRIB_PURE
    161 #else
    162 #define __MINGW_ATTRIB_MALLOC
    163 #define __MINGW_ATTRIB_PURE
    164 #endif
    165 
    166 /* Attribute `nonnull' was valid as of gcc 3.3.  We don't use GCC's
    167    variadiac macro facility, because variadic macros cause syntax
    168    errors with  --traditional-cpp.  */
    169 #if  __MINGW_GNUC_PREREQ (3, 3)
    170 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
    171 #else
    172 #define __MINGW_ATTRIB_NONNULL(arg)
    173 #endif /* GNUC >= 3.3 */
    174 
    175 #ifdef __GNUC__
    176 #define __MINGW_ATTRIB_UNUSED __attribute__ ((__unused__))
    177 #else
    178 #define __MINGW_ATTRIB_UNUSED
    179 #endif /* ATTRIBUTE_UNUSED */
    180 
    181 #if  __MINGW_GNUC_PREREQ (3, 1)
    182 #define __MINGW_ATTRIB_USED __attribute__ ((__used__))
    183 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
    184 #elif __MINGW_MSC_PREREQ(12, 0)
    185 #define __MINGW_ATTRIB_USED
    186 #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
    187 #else
    188 #define __MINGW_ATTRIB_USED __MINGW_ATTRIB_UNUSED
    189 #define __MINGW_ATTRIB_DEPRECATED
    190 #endif /* GNUC >= 3.1 */
    191 
    192 #if  __MINGW_GNUC_PREREQ (3, 3)
    193 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
    194 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
    195 #define __MINGW_NOTHROW __declspec(nothrow)
    196 #else
    197 #define __MINGW_NOTHROW
    198 #endif
    199 
    200 #if __MINGW_GNUC_PREREQ (4, 4)
    201 #define __MINGW_ATTRIB_NO_OPTIMIZE __attribute__((__optimize__ ("0")))
    202 #else
    203 #define __MINGW_ATTRIB_NO_OPTIMIZE
    204 #endif
    205 
    206 #if __MINGW_GNUC_PREREQ (4, 4)
    207 #define __MINGW_PRAGMA_PARAM(x) _Pragma (#x)
    208 #elif __MINGW_MSC_PREREQ (13, 1)
    209 #define __MINGW_PRAGMA_PARAM(x) __pragma (x)
    210 #else
    211 #define __MINGW_PRAGMA_PARAM(x)
    212 #endif
    213 
    214 #define __MINGW_BROKEN_INTERFACE(x) \
    215   __MINGW_PRAGMA_PARAM(message ("Interface " _CRT_STRINGIZE(x) \
    216   " has unverified layout."))
    217 
    218 #ifndef __MSVCRT_VERSION__
    219 /*  High byte is the major version, low byte is the minor. */
    220 # define __MSVCRT_VERSION__ 0x0700
    221 #endif
    222 
    223 
    224 #ifndef WINVER
    225 #define WINVER 0x0502
    226 #endif
    227 
    228 #ifndef _WIN32_WINNT
    229 #define _WIN32_WINNT 0x502
    230 #endif
    231 
    232 #ifndef _INT128_DEFINED
    233 #define _INT128_DEFINED
    234 #ifdef __GNUC__
    235 #define __int8 char
    236 #define __int16 short
    237 #define __int32 int
    238 #define __int64 long long
    239 #ifdef _WIN64
    240 #if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) && \
    241     !defined(__SIZEOF_INT128__) /* clang >= 3.1 has __int128 but no size macro */
    242 #define __SIZEOF_INT128__ 16
    243 #endif
    244 #ifndef __SIZEOF_INT128__
    245 typedef int __int128 __attribute__ ((__mode__ (TI)));
    246 #endif
    247 #endif
    248 #endif /* __GNUC__ */
    249 #endif /* _INT128_DEFINED */
    250 
    251 #ifdef __GNUC__
    252 #define __ptr32
    253 #define __ptr64
    254 #ifndef __unaligned
    255 #define __unaligned
    256 #endif
    257 #ifndef __w64
    258 #define __w64
    259 #endif
    260 #ifdef __cplusplus
    261 #define __forceinline inline __attribute__((__always_inline__))
    262 #else
    263 #define __forceinline extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
    264 #endif /* __cplusplus */
    265 #endif /* __GNUC__ */
    266 
    267 #if !defined(_WIN32) && !defined(__CYGWIN__)
    268 #error Only Win32 target is supported!
    269 #endif
    270 
    271 #ifndef __nothrow
    272 #ifdef __cplusplus
    273 #define __nothrow __declspec(nothrow)
    274 #else
    275 #define __nothrow
    276 #endif
    277 #endif /* __nothrow */
    278 
    279 #undef _CRT_PACKING
    280 #define _CRT_PACKING 8
    281 
    282 #include <vadefs.h>	/* other headers depend on this include */
    283 
    284 #ifndef __WIDL__
    285 #pragma pack(push,_CRT_PACKING)
    286 #endif
    287 
    288 #ifndef _CRT_STRINGIZE
    289 #define __CRT_STRINGIZE(_Value) #_Value
    290 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
    291 #endif /* _CRT_STRINGIZE */
    292 
    293 #ifndef _CRT_WIDE
    294 #define __CRT_WIDE(_String) L ## _String
    295 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
    296 #endif /* _CRT_WIDE */
    297 
    298 #ifndef _W64
    299 #define _W64
    300 #endif
    301 
    302 #ifndef _CRTIMP_NOIA64
    303 #ifdef __ia64__
    304 #define _CRTIMP_NOIA64
    305 #else
    306 #define _CRTIMP_NOIA64 _CRTIMP
    307 #endif
    308 #endif /* _CRTIMP_NOIA64 */
    309 
    310 #ifndef _CRTIMP2
    311 #define _CRTIMP2 _CRTIMP
    312 #endif
    313 
    314 #ifndef _CRTIMP_ALTERNATIVE
    315 #define _CRTIMP_ALTERNATIVE _CRTIMP
    316 #define _CRT_ALTERNATIVE_IMPORTED
    317 #endif /* _CRTIMP_ALTERNATIVE */
    318 
    319 #ifndef _MRTIMP2
    320 #define _MRTIMP2  _CRTIMP
    321 #endif
    322 
    323 /* We have to define _DLL for gcc based mingw version. This define is set
    324    by VC, when DLL-based runtime is used. So, gcc based runtime just have
    325    DLL-base runtime, therefore this define has to be set.
    326    As our headers are possibly used by windows compiler having a static
    327    C-runtime, we make this definition gnu compiler specific here.  */
    328 #if !defined (_DLL) && defined (__GNUC__)
    329 #define _DLL
    330 #endif
    331 
    332 #ifndef _MT
    333 #define _MT
    334 #endif
    335 
    336 #ifndef _MCRTIMP
    337 #define _MCRTIMP _CRTIMP
    338 #endif
    339 
    340 #ifndef _CRTIMP_PURE
    341 #define _CRTIMP_PURE _CRTIMP
    342 #endif
    343 
    344 #ifndef _PGLOBAL
    345 #define _PGLOBAL
    346 #endif
    347 
    348 #ifndef _AGLOBAL
    349 #define _AGLOBAL
    350 #endif
    351 
    352 #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
    353 #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
    354 
    355 #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
    356 #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
    357 #endif
    358 
    359 #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
    360 #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
    361 #endif
    362 
    363 #ifndef _CRT_MANAGED_HEAP_DEPRECATE
    364 #define _CRT_MANAGED_HEAP_DEPRECATE
    365 #endif
    366 
    367 #ifndef _CRT_OBSOLETE
    368 #define _CRT_OBSOLETE(_NewItem)
    369 #endif
    370 
    371 #ifndef __WIDL__
    372 
    373 #ifndef _SIZE_T_DEFINED
    374 #define _SIZE_T_DEFINED
    375 #undef size_t
    376 #ifdef _WIN64
    377 __MINGW_EXTENSION typedef unsigned __int64 size_t;
    378 #else
    379 typedef unsigned int size_t;
    380 #endif /* _WIN64 */
    381 #endif /* _SIZE_T_DEFINED */
    382 
    383 #ifndef _SSIZE_T_DEFINED
    384 #define _SSIZE_T_DEFINED
    385 #undef ssize_t
    386 #ifdef _WIN64
    387 __MINGW_EXTENSION typedef __int64 ssize_t;
    388 #else
    389 typedef int ssize_t;
    390 #endif /* _WIN64 */
    391 #endif /* _SSIZE_T_DEFINED */
    392 
    393 #ifndef _INTPTR_T_DEFINED
    394 #define _INTPTR_T_DEFINED
    395 #ifndef __intptr_t_defined
    396 #define __intptr_t_defined
    397 #undef intptr_t
    398 #ifdef _WIN64
    399 __MINGW_EXTENSION typedef __int64 intptr_t;
    400 #else
    401 typedef int intptr_t;
    402 #endif /* _WIN64 */
    403 #endif /* __intptr_t_defined */
    404 #endif /* _INTPTR_T_DEFINED */
    405 
    406 #ifndef _UINTPTR_T_DEFINED
    407 #define _UINTPTR_T_DEFINED
    408 #ifndef __uintptr_t_defined
    409 #define __uintptr_t_defined
    410 #undef uintptr_t
    411 #ifdef _WIN64
    412 __MINGW_EXTENSION typedef unsigned __int64 uintptr_t;
    413 #else
    414 typedef unsigned int uintptr_t;
    415 #endif /* _WIN64 */
    416 #endif /* __uintptr_t_defined */
    417 #endif /* _UINTPTR_T_DEFINED */
    418 
    419 #ifndef _PTRDIFF_T_DEFINED
    420 #define _PTRDIFF_T_DEFINED
    421 #ifndef _PTRDIFF_T_
    422 #define _PTRDIFF_T_
    423 #undef ptrdiff_t
    424 #ifdef _WIN64
    425 __MINGW_EXTENSION typedef __int64 ptrdiff_t;
    426 #else
    427 typedef int ptrdiff_t;
    428 #endif /* _WIN64 */
    429 #endif /* _PTRDIFF_T_ */
    430 #endif /* _PTRDIFF_T_DEFINED */
    431 
    432 #ifndef _WCHAR_T_DEFINED
    433 #define _WCHAR_T_DEFINED
    434 #if !defined(__cplusplus) && !defined(__WIDL__)
    435 typedef unsigned short wchar_t;
    436 #endif /* C++ */
    437 #endif /* _WCHAR_T_DEFINED */
    438 
    439 #ifndef _WCTYPE_T_DEFINED
    440 #define _WCTYPE_T_DEFINED
    441 #ifndef _WINT_T
    442 #define _WINT_T
    443 typedef unsigned short wint_t;
    444 typedef unsigned short wctype_t;
    445 #endif /* _WINT_T */
    446 #endif /* _WCTYPE_T_DEFINED */
    447 
    448 #if defined (_WIN32) && !defined (_WIN64) && !defined (__MINGW_USE_VC2005_COMPAT)
    449 #ifndef _USE_32BIT_TIME_T
    450 #define _USE_32BIT_TIME_T
    451 #endif
    452 #endif
    453 
    454 #ifdef _USE_32BIT_TIME_T
    455 #ifdef _WIN64
    456 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
    457 #undef _USE_32BIT_TIME_T
    458 #endif
    459 #endif /* _USE_32BIT_TIME_T */
    460 
    461 #ifndef _ERRCODE_DEFINED
    462 #define _ERRCODE_DEFINED
    463 typedef int errno_t;
    464 #endif
    465 
    466 #ifndef _TIME32_T_DEFINED
    467 #define _TIME32_T_DEFINED
    468 typedef long __time32_t;
    469 #endif
    470 
    471 #ifndef _TIME64_T_DEFINED
    472 #define _TIME64_T_DEFINED
    473 __MINGW_EXTENSION typedef __int64 __time64_t;
    474 #endif /* _TIME64_T_DEFINED */
    475 
    476 #ifndef _TIME_T_DEFINED
    477 #define _TIME_T_DEFINED
    478 #ifdef _USE_32BIT_TIME_T
    479 typedef __time32_t time_t;
    480 #else
    481 typedef __time64_t time_t;
    482 #endif
    483 #endif /* _TIME_T_DEFINED */
    484 
    485 #ifndef _CONST_RETURN
    486 #define _CONST_RETURN
    487 #endif
    488 
    489 #ifndef UNALIGNED
    490 #if defined(_M_IA64) || defined(_M_AMD64)
    491 #define UNALIGNED __unaligned
    492 #else
    493 #define UNALIGNED
    494 #endif
    495 #endif /* UNALIGNED */
    496 
    497 #ifndef _CRT_ALIGN
    498 #ifdef  _MSC_VER
    499 #define _CRT_ALIGN(x) __declspec(align(x))
    500 #else /* __GNUC__ */
    501 #define _CRT_ALIGN(x) __attribute__ ((__aligned__ (x)))
    502 #endif
    503 #endif /* _CRT_ALIGN */
    504 
    505 #endif /* __WIDL__ */
    506 
    507 #ifndef __CRTDECL
    508 #define __CRTDECL __cdecl
    509 #endif
    510 
    511 #define _ARGMAX 100
    512 
    513 #ifndef _TRUNCATE
    514 #define _TRUNCATE ((size_t)-1)
    515 #endif
    516 
    517 #ifndef _CRT_UNUSED
    518 #define _CRT_UNUSED(x) (void)x
    519 #endif
    520 
    521 /* MSVC defines _NATIVE_NULLPTR_SUPPORTED when nullptr is supported. We emulate it here for GCC. */
    522 #if __MINGW_GNUC_PREREQ(4, 6)
    523 #if defined(__GNUC__) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
    524 #define _NATIVE_NULLPTR_SUPPORTED
    525 #endif
    526 #endif
    527 
    528 /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
    529    Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
    530 #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
    531      || defined (_ISOC99_SOURCE) \
    532      || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
    533      || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
    534      || defined (_SVID_SOURCE)) \
    535     && !defined(__USE_MINGW_ANSI_STDIO)
    536 /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
    537  * and If user did _not_ specify it explicitly... */
    538 #  define __USE_MINGW_ANSI_STDIO			1
    539 #endif
    540 
    541 /* _dowildcard is an int that controls the globbing of the command line.
    542  * The MinGW32 (mingw.org) runtime calls it _CRT_glob, so we are adding
    543  * a compatibility definition here:  you can use either of _CRT_glob or
    544  * _dowildcard .
    545  * If _dowildcard is non-zero, the command line will be globbed:  *.*
    546  * will be expanded to be all files in the startup directory.
    547  * In the mingw-w64 library a _dowildcard variable is defined as being
    548  * 0, therefore command line globbing is DISABLED by default. To turn it
    549  * on and to leave wildcard command line processing MS's globbing code,
    550  * include a line in one of your source modules defining _dowildcard and
    551  * setting it to -1, like so:
    552  * int _dowildcard = -1;
    553  */
    554 #undef  _CRT_glob
    555 #define _CRT_glob _dowildcard
    556 
    557 
    558 #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
    559 #define NONAMELESSUNION		1
    560 #endif
    561 #if defined(NONAMELESSSTRUCT) && \
    562    !defined(NONAMELESSUNION)
    563 #define NONAMELESSUNION		1
    564 #endif
    565 #if defined(NONAMELESSUNION)  && \
    566    !defined(NONAMELESSSTRUCT)
    567 #define NONAMELESSSTRUCT	1
    568 #endif
    569 
    570 #ifndef __ANONYMOUS_DEFINED
    571 #define __ANONYMOUS_DEFINED
    572 #define _ANONYMOUS_UNION  __MINGW_EXTENSION
    573 #define _ANONYMOUS_STRUCT __MINGW_EXTENSION
    574 #ifndef NONAMELESSUNION
    575 #define _UNION_NAME(x)
    576 #define _STRUCT_NAME(x)
    577 #else /* NONAMELESSUNION */
    578 #define _UNION_NAME(x)  x
    579 #define _STRUCT_NAME(x) x
    580 #endif
    581 #endif	/* __ANONYMOUS_DEFINED */
    582 
    583 #ifndef DUMMYUNIONNAME
    584 # ifdef NONAMELESSUNION
    585 #  define DUMMYUNIONNAME  u
    586 #  define DUMMYUNIONNAME1 u1	/* Wine uses this variant */
    587 #  define DUMMYUNIONNAME2 u2
    588 #  define DUMMYUNIONNAME3 u3
    589 #  define DUMMYUNIONNAME4 u4
    590 #  define DUMMYUNIONNAME5 u5
    591 #  define DUMMYUNIONNAME6 u6
    592 #  define DUMMYUNIONNAME7 u7
    593 #  define DUMMYUNIONNAME8 u8
    594 #  define DUMMYUNIONNAME9 u9
    595 # else /* NONAMELESSUNION */
    596 #  define DUMMYUNIONNAME
    597 #  define DUMMYUNIONNAME1	/* Wine uses this variant */
    598 #  define DUMMYUNIONNAME2
    599 #  define DUMMYUNIONNAME3
    600 #  define DUMMYUNIONNAME4
    601 #  define DUMMYUNIONNAME5
    602 #  define DUMMYUNIONNAME6
    603 #  define DUMMYUNIONNAME7
    604 #  define DUMMYUNIONNAME8
    605 #  define DUMMYUNIONNAME9
    606 # endif
    607 #endif	/* DUMMYUNIONNAME */
    608 
    609 #ifndef DUMMYSTRUCTNAME
    610 # ifdef NONAMELESSUNION
    611 #  define DUMMYSTRUCTNAME  s
    612 #  define DUMMYSTRUCTNAME1 s1	/* Wine uses this variant */
    613 #  define DUMMYSTRUCTNAME2 s2
    614 #  define DUMMYSTRUCTNAME3 s3
    615 #  define DUMMYSTRUCTNAME4 s4
    616 #  define DUMMYSTRUCTNAME5 s5
    617 # else
    618 #  define DUMMYSTRUCTNAME
    619 #  define DUMMYSTRUCTNAME1	/* Wine uses this variant */
    620 #  define DUMMYSTRUCTNAME2
    621 #  define DUMMYSTRUCTNAME3
    622 #  define DUMMYSTRUCTNAME4
    623 #  define DUMMYSTRUCTNAME5
    624 # endif
    625 #endif /* DUMMYSTRUCTNAME */
    626 
    627 
    628 /* Macros for __uuidof template-based emulation */
    629 #if defined(__cplusplus) && (USE___UUIDOF == 0)
    630 
    631 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)           \
    632     extern "C++" {                                                      \
    633     template<> inline const GUID &__mingw_uuidof<type>() {              \
    634         static const IID __uuid_inst = {l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \
    635         return __uuid_inst;                                             \
    636     }                                                                   \
    637     template<> inline const GUID &__mingw_uuidof<type*>() {             \
    638         return __mingw_uuidof<type>();                                  \
    639     }                                                                   \
    640     }
    641 
    642 #define __uuidof(type) __mingw_uuidof<__typeof(type)>()
    643 
    644 #else
    645 
    646 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
    647 
    648 #endif
    649 
    650 #ifdef __cplusplus
    651 extern "C" {
    652 #endif
    653 
    654 #ifdef __MINGW_INTRIN_INLINE
    655 #if !defined (__clang__)
    656 void __cdecl __debugbreak(void);
    657 __MINGW_INTRIN_INLINE void __cdecl __debugbreak(void)
    658 {
    659   __asm__ __volatile__("int $3");
    660 }
    661 #endif
    662 #endif
    663 
    664 /* mingw-w64 specific functions: */
    665 const char *__mingw_get_crt_info (void);
    666 
    667 #ifdef __cplusplus
    668 }
    669 #endif
    670 
    671 #ifndef __WIDL__
    672 #pragma pack(pop)
    673 #endif
    674 
    675 #endif /* _INC__MINGW_H */
    676 
    677 #ifndef MINGW_SDK_INIT
    678 #define MINGW_SDK_INIT
    679 
    680 #ifdef MINGW_HAS_SECURE_API
    681 #define __STDC_SECURE_LIB__ 200411L
    682 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
    683 #endif
    684 
    685 #ifndef __WIDL__
    686 #include "sdks/_mingw_directx.h"
    687 #include "sdks/_mingw_ddk.h"
    688 #endif
    689 
    690 #endif /* MINGW_SDK_INIT */
    691