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.
12 #define MINGW64_VERSION 1.0
13 #define MINGW64_VERSION_MAJOR 1
14 #define MINGW64_VERSION_MINOR 0
15 #define MINGW64_VERSION_STATE "alpha"
27 # ifndef __MINGW_IMPORT
28 # define __MINGW_IMPORT __declspec(dllimport)
31 # define _CRTIMP __declspec(dllimport)
34 # ifndef __MINGW_IMPORT
35 # define __MINGW_IMPORT
41 # define __DECLSPEC_SUPPORTED
42 # define __attribute__(x) /* nothing */
43 # define __restrict__/* nothing */
44 #elif defined(__GNUC__)
46 # ifndef __MINGW_IMPORT
48 /* Note the extern. This is needed to work around GCC's
49 limitations in handling dllimport attribute. */
50 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
52 # define __MINGW_IMPORT extern
57 # if !defined (_CRTBLD) && !defined (_SYSCRT)
58 # define __USE_CRTIMP 1
62 # define _CRTIMP __attribute__ ((dllimport))
70 # define __DECLSPEC_SUPPORTED
71 # else /* __declspec */
72 # undef __DECLSPEC_SUPPORTED
73 # undef __MINGW_IMPORT
77 # endif /* __declspec */
79 # ifndef __MINGW_IMPORT
80 # define __MINGW_IMPORT __declspec(dllimport)
83 # define _CRTIMP __declspec(dllimport)
85 # define __DECLSPEC_SUPPORTED
86 # define __attribute__(x)/* nothing */
89 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
90 #define __MINGW_GNUC_PREREQ(major, minor) \
92 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
94 #define __MINGW_GNUC_PREREQ(major, minor) 0
97 #if defined (_MSC_VER)
98 #define __MINGW_MSC_PREREQ(major,minor) \
99 ((_MSC_VER /100) > (major) \
100 || ((_MSC)VER /100) == (major) && (_MSC_VER) % 100) >=(minor)))
102 #define __MINGW_MSC_PREREQ(major, minor) 0
105 #define USE___UUIDOF 0
108 # define __CRT_INLINE inline
110 # if defined(_MSC_VER)
111 # define __CRT_INLINE __inline
112 # elif __GNUC_STDC_INLINE__
113 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
115 # define __CRT_INLINE extern __inline__
120 # define __UNUSED_PARAM(x)
123 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
125 # define __UNUSED_PARAM(x) x
130 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
131 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
132 #elif __MINGW_MSC_PREREQ(12, 0)
133 #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
134 #define __MINGW_ATTRIB_CONST
136 #define __MINGW_ATTRIB_NORETURN
137 #define __MINGW_ATTRIB_CONST
140 #if __MINGW_GNUC_PREREQ (3, 0)
141 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
142 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
144 #define __MINGW_ATTRIB_MALLOC
145 #define __MINGW_ATTRIB_PURE
148 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
149 variadiac macro facility, because variadic macros cause syntax
150 errors with --traditional-cpp. */
151 #if __MINGW_GNUC_PREREQ (3, 3)
152 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
154 #define __MINGW_ATTRIB_NONNULL(arg)
155 #endif /* GNUC >= 3.3 */
157 #if __MINGW_GNUC_PREREQ (3, 1)
158 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
159 #elif __MINGW_MSC_PREREQ(12, 0)
160 #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
162 #define __MINGW_ATTRIB_DEPRECATED
165 #if __MINGW_GNUC_PREREQ (3, 3)
166 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
167 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
168 #define __MINGW_NOTHROW __declspec(nothrow)
170 #define __MINGW_NOTHROW
173 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
174 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
176 #ifndef __MSVCRT_VERSION__
177 /* High byte is the major version, low byte is the minor. */
178 # define __MSVCRT_VERSION__ 0x0700
181 #if defined(__GNUC__)
182 #define __mingw_va_start(v,l) __builtin_va_start(v,l)
183 #define __mingw_va_end(v) __builtin_va_end(v)
184 #define __mingw_va_arg(v,l) __builtin_va_arg(v,l)
185 #define __mingw_va_copy(d,s) __builtin_va_copy(d,s)
186 #elif defined(_MSC_VER)
187 #define __mingw_va_start(v,l) __msc_va_start(v,l)
188 #define __mingw_va_end(v) __msc_va_end(v)
189 #define __mingw_va_arg(v,l) __msc_va_arg(v,l)
190 #define __mingw_va_copy(d,s) __msc_va_copy(d,s)
194 //#define WINVER 0x0502
198 #define _WIN32_WINNT 0x502
201 #ifndef _INT128_DEFINED
202 #define _INT128_DEFINED
205 #define __int16 short
207 #define __int64 long long
210 typedef int __int128
__attribute__ ((mode (TI
)));
216 #define __unaligned __attribute ((packed))
217 #define __forceinline extern __inline
222 #error Only Win32 target is supported!
227 #define __nothrow __declspec(nothrow)
236 #define _CRT_PACKING 8
239 #undef USE_MINGW_SETJMP_TWO_ARGS
240 #define USE_MINGW_SETJMP_TWO_ARGS
243 #pragma pack(push,_CRT_PACKING)
251 #ifndef _CRT_STRINGIZE
252 #define __CRT_STRINGIZE(_Value) #_Value
253 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
257 #define __CRT_WIDE(_String) L ## _String
258 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
264 #ifndef _CRTIMP_NOIA64
266 #define _CRTIMP_NOIA64
268 #define _CRTIMP_NOIA64 _CRTIMP
273 #define _CRTIMP2 _CRTIMP
276 #ifndef _CRTIMP_ALTERNATIVE
277 #define _CRTIMP_ALTERNATIVE _CRTIMP
278 #define _CRT_ALTERNATIVE_IMPORTED
282 #define _MRTIMP2 _CRTIMP
294 #define _MCRTIMP _CRTIMP
298 #define _CRTIMP_PURE _CRTIMP
309 #define __STDC_SECURE_LIB__ 200411L
310 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
311 #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
312 #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
314 #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
315 #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
317 #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
318 #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
320 #ifndef _CRT_MANAGED_HEAP_DEPRECATE
321 #define _CRT_MANAGED_HEAP_DEPRECATE
324 #ifndef _CRT_OBSOLETE
325 #define _CRT_OBSOLETE(_NewItem)
328 #ifndef _SIZE_T_DEFINED
329 #define _SIZE_T_DEFINED
332 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
333 typedef unsigned int size_t __attribute__ ((mode (DI
)));
335 typedef unsigned __int64
size_t;
338 typedef unsigned int size_t;
342 #ifndef _SSIZE_T_DEFINED
343 #define _SSIZE_T_DEFINED
346 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
347 typedef int ssize_t
__attribute__ ((mode (DI
)));
349 typedef __int64 ssize_t
;
356 #ifndef _INTPTR_T_DEFINED
357 #define _INTPTR_T_DEFINED
358 #ifndef __intptr_t_defined
359 #define __intptr_t_defined
362 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
363 typedef int intptr_t __attribute__ ((mode (DI
)));
365 typedef __int64
intptr_t;
368 typedef int intptr_t;
373 #ifndef _UINTPTR_T_DEFINED
374 #define _UINTPTR_T_DEFINED
375 #ifndef __uintptr_t_defined
376 #define __uintptr_t_defined
379 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
380 typedef unsigned int uintptr_t __attribute__ ((mode (DI
)));
382 typedef unsigned __int64
uintptr_t;
385 typedef unsigned int uintptr_t;
390 #ifndef _PTRDIFF_T_DEFINED
391 #define _PTRDIFF_T_DEFINED
395 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
396 typedef int ptrdiff_t __attribute__ ((mode (DI
)));
398 typedef __int64
ptrdiff_t;
401 typedef int ptrdiff_t;
406 #ifndef _WCHAR_T_DEFINED
407 #define _WCHAR_T_DEFINED
409 typedef unsigned short wchar_t;
413 #ifndef _WCTYPE_T_DEFINED
414 #define _WCTYPE_T_DEFINED
415 typedef unsigned short wint_t;
416 typedef unsigned short wctype_t;
419 #ifndef __GNUC_VA_LIST
420 #define __GNUC_VA_LIST
421 typedef __builtin_va_list __gnuc_va_list
;
424 #ifndef _VA_LIST_DEFINED
425 #define _VA_LIST_DEFINED
426 typedef __gnuc_va_list
va_list;
429 #ifdef _USE_32BIT_TIME_T
431 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
432 #undef _USE_32BIT_TIME_T
435 #if _INTEGRAL_MAX_BITS < 64
436 #define _USE_32BIT_TIME_T
440 #ifndef _ERRCODE_DEFINED
441 #define _ERRCODE_DEFINED
446 #ifndef _TIME32_T_DEFINED
447 #define _TIME32_T_DEFINED
448 typedef long __time32_t
;
451 #ifndef _TIME64_T_DEFINED
452 #define _TIME64_T_DEFINED
453 //#if _INTEGRAL_MAX_BITS >= 64
454 typedef __int64 __time64_t
;
458 #ifndef _TIME_T_DEFINED
459 #define _TIME_T_DEFINED
460 #ifdef _USE_32BIT_TIME_T
461 typedef __time32_t
time_t;
463 typedef __time64_t
time_t;
467 #ifndef _CONST_RETURN
468 #define _CONST_RETURN
471 #ifndef __CRT_UNALIGNED
472 #define __CRT_UNALIGNED
476 #if defined(__ia64__) || defined(__x86_64)
477 //#define UNALIGNED __CRT_UNALIGNED
484 #define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
496 #define __CRTDECL __cdecl
502 #define _TRUNCATE ((size_t)-1)
504 struct threadlocaleinfostruct
;
505 struct threadmbcinfostruct
;
506 typedef struct threadlocaleinfostruct
*pthreadlocinfo
;
507 typedef struct threadmbcinfostruct
*pthreadmbcinfo
;
508 struct __lc_time_data
;
510 typedef struct localeinfo_struct
{
511 pthreadlocinfo locinfo
;
512 pthreadmbcinfo mbcinfo
;
513 } _locale_tstruct
,*_locale_t
;
515 #ifndef _TAGLC_ID_DEFINED
516 #define _TAGLC_ID_DEFINED
517 typedef struct tagLC_ID
{
518 unsigned short wLanguage
;
519 unsigned short wCountry
;
520 unsigned short wCodePage
;
524 #ifndef _THREADLOCALEINFO
525 #define _THREADLOCALEINFO
526 typedef struct threadlocaleinfostruct
{
528 unsigned int lc_codepage
;
529 unsigned int lc_collate_cp
;
530 unsigned long lc_handle
[6];
540 int *lconv_intl_refcount
;
541 int *lconv_num_refcount
;
542 int *lconv_mon_refcount
;
544 int *ctype1_refcount
;
545 unsigned short *ctype1
;
546 const unsigned short *pctype
;
547 const unsigned char *pclmap
;
548 const unsigned char *pcumap
;
549 struct __lc_time_data
*lc_time_curr
;
557 #define __crt_typefix(ctype)
560 #define _CRT_UNUSED(x) (void)x