2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
10 #define _INTEGRAL_MAX_BITS 64
14 #define MINGW64_VERSION 1.0
15 #define MINGW64_VERSION_MAJOR 1
16 #define MINGW64_VERSION_MINOR 0
17 #define MINGW64_VERSION_STATE "alpha"
29 # ifndef __MINGW_IMPORT
30 # define __MINGW_IMPORT __declspec(dllimport)
33 # define _CRTIMP __declspec(dllimport)
36 # ifndef __MINGW_IMPORT
37 # define __MINGW_IMPORT
43 # define __DECLSPEC_SUPPORTED
44 # define __attribute__(x) /* nothing */
45 # define __restrict__/* nothing */
46 #elif defined(__GNUC__)
48 # ifndef __MINGW_IMPORT
50 /* Note the extern. This is needed to work around GCC's
51 limitations in handling dllimport attribute. */
52 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
54 # define __MINGW_IMPORT extern
59 # if !defined (_CRTBLD) && !defined (_SYSCRT)
60 # define __USE_CRTIMP 1
64 # define _CRTIMP __attribute__ ((dllimport))
72 # define __DECLSPEC_SUPPORTED
73 # else /* __declspec */
74 # undef __DECLSPEC_SUPPORTED
75 # undef __MINGW_IMPORT
79 # endif /* __declspec */
81 # ifndef __MINGW_IMPORT
82 # define __MINGW_IMPORT __declspec(dllimport)
85 # define _CRTIMP __declspec(dllimport)
87 # define __DECLSPEC_SUPPORTED
88 # define __attribute__(x)/* nothing */
91 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
92 #define __MINGW_GNUC_PREREQ(major, minor) \
94 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
96 #define __MINGW_GNUC_PREREQ(major, minor) 0
99 #if defined (_MSC_VER)
100 #define __MINGW_MSC_PREREQ(major,minor) \
101 ((_MSC_VER /100) > (major) \
102 || ((_MSC)VER /100) == (major) && (_MSC_VER) % 100) >=(minor)))
104 #define __MINGW_MSC_PREREQ(major, minor) 0
107 #define USE___UUIDOF 0
110 # define __CRT_INLINE inline
112 # if defined(_MSC_VER)
113 # define __CRT_INLINE __inline
114 # elif __GNUC_STDC_INLINE__
115 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
117 # define __CRT_INLINE extern __inline__
122 # define __UNUSED_PARAM(x)
125 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
127 # define __UNUSED_PARAM(x) x
132 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
133 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
134 #elif __MINGW_MSC_PREREQ(12, 0)
135 #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
136 #define __MINGW_ATTRIB_CONST
138 #define __MINGW_ATTRIB_NORETURN
139 #define __MINGW_ATTRIB_CONST
142 #if __MINGW_GNUC_PREREQ (3, 0)
143 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
144 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
146 #define __MINGW_ATTRIB_MALLOC
147 #define __MINGW_ATTRIB_PURE
150 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
151 variadiac macro facility, because variadic macros cause syntax
152 errors with --traditional-cpp. */
153 #if __MINGW_GNUC_PREREQ (3, 3)
154 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
156 #define __MINGW_ATTRIB_NONNULL(arg)
157 #endif /* GNUC >= 3.3 */
159 #if __MINGW_GNUC_PREREQ (3, 1)
160 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
161 #elif __MINGW_MSC_PREREQ(12, 0)
162 #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
164 #define __MINGW_ATTRIB_DEPRECATED
167 #if __MINGW_GNUC_PREREQ (3, 3)
168 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
169 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
170 #define __MINGW_NOTHROW __declspec(nothrow)
172 #define __MINGW_NOTHROW
175 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
176 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
178 #ifndef __MSVCRT_VERSION__
179 /* High byte is the major version, low byte is the minor. */
180 # define __MSVCRT_VERSION__ 0x0700
183 #if defined(__GNUC__)
184 #define __mingw_va_start(v,l) __builtin_va_start(v,l)
185 #define __mingw_va_end(v) __builtin_va_end(v)
186 #define __mingw_va_arg(v,l) __builtin_va_arg(v,l)
187 #define __mingw_va_copy(d,s) __builtin_va_copy(d,s)
188 #elif defined(_MSC_VER)
189 #define __mingw_va_start(v,l) __msc_va_start(v,l)
190 #define __mingw_va_end(v) __msc_va_end(v)
191 #define __mingw_va_arg(v,l) __msc_va_arg(v,l)
192 #define __mingw_va_copy(d,s) __msc_va_copy(d,s)
196 //#define WINVER 0x0502
200 #define _WIN32_WINNT 0x502
203 #ifndef _INT128_DEFINED
204 #define _INT128_DEFINED
207 #define __int16 short
209 #define __int64 long long
212 typedef int __int128
__attribute__ ((mode (TI
)));
218 #define __unaligned __attribute ((packed))
219 #define __forceinline extern __inline
224 #error Only Win32 target is supported!
229 #define __nothrow __declspec(nothrow)
238 #define _CRT_PACKING 8
241 #undef USE_MINGW_SETJMP_TWO_ARGS
242 #define USE_MINGW_SETJMP_TWO_ARGS
245 #pragma pack(push,_CRT_PACKING)
253 #ifndef _CRT_STRINGIZE
254 #define __CRT_STRINGIZE(_Value) #_Value
255 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
259 #define __CRT_WIDE(_String) L ## _String
260 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
266 #ifndef _CRTIMP_NOIA64
268 #define _CRTIMP_NOIA64
270 #define _CRTIMP_NOIA64 _CRTIMP
275 #define _CRTIMP2 _CRTIMP
278 #ifndef _CRTIMP_ALTERNATIVE
279 #define _CRTIMP_ALTERNATIVE _CRTIMP
280 #define _CRT_ALTERNATIVE_IMPORTED
284 #define _MRTIMP2 _CRTIMP
296 #define _MCRTIMP _CRTIMP
300 #define _CRTIMP_PURE _CRTIMP
311 #define __STDC_SECURE_LIB__ 200411L
312 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
313 #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
314 #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
316 #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
317 #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
319 #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
320 #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
322 #ifndef _CRT_MANAGED_HEAP_DEPRECATE
323 #define _CRT_MANAGED_HEAP_DEPRECATE
326 #ifndef _CRT_OBSOLETE
327 #define _CRT_OBSOLETE(_NewItem)
330 #ifndef _SIZE_T_DEFINED
331 #define _SIZE_T_DEFINED
334 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
335 typedef unsigned int size_t __attribute__ ((mode (DI
)));
337 typedef unsigned __int64
size_t;
340 typedef unsigned int size_t;
344 #ifndef _SSIZE_T_DEFINED
345 #define _SSIZE_T_DEFINED
348 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
349 typedef int ssize_t
__attribute__ ((mode (DI
)));
351 typedef __int64 ssize_t
;
358 #ifndef _INTPTR_T_DEFINED
359 #define _INTPTR_T_DEFINED
360 #ifndef __intptr_t_defined
361 #define __intptr_t_defined
364 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
365 typedef int intptr_t __attribute__ ((mode (DI
)));
367 typedef __int64
intptr_t;
370 typedef int intptr_t;
375 #ifndef _UINTPTR_T_DEFINED
376 #define _UINTPTR_T_DEFINED
377 #ifndef __uintptr_t_defined
378 #define __uintptr_t_defined
381 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
382 typedef unsigned int uintptr_t __attribute__ ((mode (DI
)));
384 typedef unsigned __int64
uintptr_t;
387 typedef unsigned int uintptr_t;
392 #ifndef _PTRDIFF_T_DEFINED
393 #define _PTRDIFF_T_DEFINED
397 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
398 typedef int ptrdiff_t __attribute__ ((mode (DI
)));
400 typedef __int64
ptrdiff_t;
403 typedef int ptrdiff_t;
408 #ifndef _WCHAR_T_DEFINED
409 #define _WCHAR_T_DEFINED
411 typedef unsigned short wchar_t;
415 #ifndef _WCTYPE_T_DEFINED
416 #define _WCTYPE_T_DEFINED
417 typedef unsigned short wint_t;
418 typedef unsigned short wctype_t;
421 #ifndef __GNUC_VA_LIST
422 #define __GNUC_VA_LIST
423 typedef __builtin_va_list __gnuc_va_list
;
426 #ifndef _VA_LIST_DEFINED
427 #define _VA_LIST_DEFINED
428 typedef __gnuc_va_list
va_list;
431 #ifdef _USE_32BIT_TIME_T
433 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
434 #undef _USE_32BIT_TIME_T
437 #if _INTEGRAL_MAX_BITS < 64
438 #define _USE_32BIT_TIME_T
442 #ifndef _ERRCODE_DEFINED
443 #define _ERRCODE_DEFINED
448 #ifndef _TIME32_T_DEFINED
449 #define _TIME32_T_DEFINED
450 typedef long __time32_t
;
453 #ifndef _TIME64_T_DEFINED
454 #define _TIME64_T_DEFINED
455 //#if _INTEGRAL_MAX_BITS >= 64
456 typedef __int64 __time64_t
;
460 #ifndef _TIME_T_DEFINED
461 #define _TIME_T_DEFINED
462 #ifdef _USE_32BIT_TIME_T
463 typedef __time32_t
time_t;
465 typedef __time64_t
time_t;
469 #ifndef _CONST_RETURN
470 #define _CONST_RETURN
473 #ifndef __CRT_UNALIGNED
474 #define __CRT_UNALIGNED
478 #if defined(__ia64__) || defined(__x86_64)
479 //#define UNALIGNED __CRT_UNALIGNED
486 #define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
498 #define __CRTDECL __cdecl
504 #define _TRUNCATE ((size_t)-1)
506 struct threadlocaleinfostruct
;
507 struct threadmbcinfostruct
;
508 typedef struct threadlocaleinfostruct
*pthreadlocinfo
;
509 typedef struct threadmbcinfostruct
*pthreadmbcinfo
;
510 struct __lc_time_data
;
512 typedef struct localeinfo_struct
{
513 pthreadlocinfo locinfo
;
514 pthreadmbcinfo mbcinfo
;
515 } _locale_tstruct
,*_locale_t
;
517 #ifndef _TAGLC_ID_DEFINED
518 #define _TAGLC_ID_DEFINED
519 typedef struct tagLC_ID
{
520 unsigned short wLanguage
;
521 unsigned short wCountry
;
522 unsigned short wCodePage
;
526 #ifndef _THREADLOCALEINFO
527 #define _THREADLOCALEINFO
528 typedef struct threadlocaleinfostruct
{
530 unsigned int lc_codepage
;
531 unsigned int lc_collate_cp
;
532 unsigned long lc_handle
[6];
542 int *lconv_intl_refcount
;
543 int *lconv_num_refcount
;
544 int *lconv_mon_refcount
;
546 int *ctype1_refcount
;
547 unsigned short *ctype1
;
548 const unsigned short *pctype
;
549 const unsigned char *pclmap
;
550 const unsigned char *pcumap
;
551 struct __lc_time_data
*lc_time_curr
;
559 #define __crt_typefix(ctype)
562 #define _CRT_UNUSED(x) (void)x