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
13 #ifndef _USE_32BIT_TIME_T
14 #define _USE_32BIT_TIME_T
20 #define MINGW64_VERSION 1.0
21 #define MINGW64_VERSION_MAJOR 1
22 #define MINGW64_VERSION_MINOR 0
23 #define MINGW64_VERSION_STATE "alpha"
35 # ifndef __MINGW_IMPORT
36 # define __MINGW_IMPORT __declspec(dllimport)
39 # define _CRTIMP __declspec(dllimport)
42 # ifndef __MINGW_IMPORT
43 # define __MINGW_IMPORT
49 # define __DECLSPEC_SUPPORTED
50 # define __attribute__(x) /* nothing */
51 # define __restrict__ /* nothing */
52 #elif defined(__GNUC__)
54 # ifndef __MINGW_IMPORT
56 /* Note the extern. This is needed to work around GCC's
57 limitations in handling dllimport attribute. */
58 # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
60 # define __MINGW_IMPORT extern
65 # if !defined (_CRTBLD) && !defined (_SYSCRT)
66 # define __USE_CRTIMP 1
70 # define _CRTIMP __attribute__ ((dllimport))
78 # define __DECLSPEC_SUPPORTED
79 # else /* __declspec */
80 # undef __DECLSPEC_SUPPORTED
81 # undef __MINGW_IMPORT
85 # endif /* __declspec */
87 # ifndef __MINGW_IMPORT
88 # define __MINGW_IMPORT __declspec(dllimport)
91 # define _CRTIMP __declspec(dllimport)
93 # define __DECLSPEC_SUPPORTED
94 # define __attribute__(x) /* nothing */
97 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
98 #define __MINGW_GNUC_PREREQ(major, minor) \
100 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
102 #define __MINGW_GNUC_PREREQ(major, minor) 0
105 #if defined (_MSC_VER)
106 #define __MINGW_MSC_PREREQ(major,minor) \
107 ((_MSC_VER /100) > (major) \
108 || ((_MSC)VER /100) == (major) && (_MSC_VER) % 100) >=(minor)))
110 #define __MINGW_MSC_PREREQ(major, minor) 0
113 #define USE___UUIDOF 0
116 # define __CRT_INLINE inline
118 # if defined(_MSC_VER)
119 # define __CRT_INLINE __inline
120 # elif __GNUC_STDC_INLINE__
121 # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
123 # define __CRT_INLINE extern __inline__
128 # define __UNUSED_PARAM(x)
131 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
133 # define __UNUSED_PARAM(x) x
138 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
139 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
140 #elif __MINGW_MSC_PREREQ(12, 0)
141 #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
142 #define __MINGW_ATTRIB_CONST
144 #define __MINGW_ATTRIB_NORETURN
145 #define __MINGW_ATTRIB_CONST
148 #if __MINGW_GNUC_PREREQ (3, 0)
149 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
150 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
152 #define __MINGW_ATTRIB_MALLOC
153 #define __MINGW_ATTRIB_PURE
156 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
157 variadiac macro facility, because variadic macros cause syntax
158 errors with --traditional-cpp. */
159 #if __MINGW_GNUC_PREREQ (3, 3)
160 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
162 #define __MINGW_ATTRIB_NONNULL(arg)
163 #endif /* GNUC >= 3.3 */
165 #if __MINGW_GNUC_PREREQ (3, 1)
166 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
167 #elif __MINGW_MSC_PREREQ(12, 0)
168 #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
170 #define __MINGW_ATTRIB_DEPRECATED
173 #if __MINGW_GNUC_PREREQ (3, 3)
174 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
175 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
176 #define __MINGW_NOTHROW __declspec(nothrow)
178 #define __MINGW_NOTHROW
181 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
182 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
184 #ifndef __MSVCRT_VERSION__
185 /* High byte is the major version, low byte is the minor. */
186 # define __MSVCRT_VERSION__ 0x0700
189 #if defined(__GNUC__)
190 #define __mingw_va_start(v,l) __builtin_va_start(v,l)
191 #define __mingw_va_end(v) __builtin_va_end(v)
192 #define __mingw_va_arg(v,l) __builtin_va_arg(v,l)
193 #define __mingw_va_copy(d,s) __builtin_va_copy(d,s)
194 #elif defined(_MSC_VER)
195 #define __mingw_va_start(v,l) __msc_va_start(v,l)
196 #define __mingw_va_end(v) __msc_va_end(v)
197 #define __mingw_va_arg(v,l) __msc_va_arg(v,l)
198 #define __mingw_va_copy(d,s) __msc_va_copy(d,s)
202 //#define WINVER 0x0502
206 #define _WIN32_WINNT 0x502
209 #ifndef _INT128_DEFINED
210 #define _INT128_DEFINED
213 #define __int16 short
215 #define __int64 long long
218 typedef int __int128
__attribute__ ((mode (TI
)));
224 #define __unaligned __attribute ((packed))
225 #define __forceinline extern __inline
230 #error Only Win32 target is supported!
235 #define __nothrow __declspec(nothrow)
244 #define _CRT_PACKING 8
247 #undef USE_MINGW_SETJMP_TWO_ARGS
248 #define USE_MINGW_SETJMP_TWO_ARGS
251 #pragma pack(push,_CRT_PACKING)
259 #ifndef _CRT_STRINGIZE
260 #define __CRT_STRINGIZE(_Value) #_Value
261 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
265 #define __CRT_WIDE(_String) L ## _String
266 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
272 #ifndef _CRTIMP_NOIA64
274 #define _CRTIMP_NOIA64
276 #define _CRTIMP_NOIA64 _CRTIMP
281 #define _CRTIMP2 _CRTIMP
284 #ifndef _CRTIMP_ALTERNATIVE
285 #define _CRTIMP_ALTERNATIVE _CRTIMP
286 #define _CRT_ALTERNATIVE_IMPORTED
290 #define _MRTIMP2 _CRTIMP
302 #define _MCRTIMP _CRTIMP
306 #define _CRTIMP_PURE _CRTIMP
317 #define __STDC_SECURE_LIB__ 200411L
318 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
319 #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
320 #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
322 #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
323 #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
325 #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
326 #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
328 #ifndef _CRT_MANAGED_HEAP_DEPRECATE
329 #define _CRT_MANAGED_HEAP_DEPRECATE
332 #ifndef _CRT_OBSOLETE
333 #define _CRT_OBSOLETE(_NewItem)
336 #ifndef _SIZE_T_DEFINED
337 #define _SIZE_T_DEFINED
340 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
341 typedef unsigned int size_t __attribute__ ((mode (DI
)));
343 typedef unsigned __int64
size_t;
346 typedef unsigned int size_t;
350 #ifndef _SSIZE_T_DEFINED
351 #define _SSIZE_T_DEFINED
354 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
355 typedef int ssize_t
__attribute__ ((mode (DI
)));
357 typedef __int64 ssize_t
;
364 #ifndef _INTPTR_T_DEFINED
365 #define _INTPTR_T_DEFINED
366 #ifndef __intptr_t_defined
367 #define __intptr_t_defined
370 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
371 typedef int intptr_t __attribute__ ((mode (DI
)));
373 typedef __int64
intptr_t;
376 typedef int intptr_t;
381 #ifndef _UINTPTR_T_DEFINED
382 #define _UINTPTR_T_DEFINED
383 #ifndef __uintptr_t_defined
384 #define __uintptr_t_defined
387 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
388 typedef unsigned int uintptr_t __attribute__ ((mode (DI
)));
390 typedef unsigned __int64
uintptr_t;
393 typedef unsigned int uintptr_t;
398 #ifndef _PTRDIFF_T_DEFINED
399 #define _PTRDIFF_T_DEFINED
403 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
404 typedef int ptrdiff_t __attribute__ ((mode (DI
)));
406 typedef __int64
ptrdiff_t;
409 typedef int ptrdiff_t;
414 #ifndef _WCHAR_T_DEFINED
415 #define _WCHAR_T_DEFINED
417 typedef unsigned short wchar_t;
421 #ifndef _WCTYPE_T_DEFINED
422 #define _WCTYPE_T_DEFINED
423 typedef unsigned short wint_t;
424 typedef unsigned short wctype_t;
427 #ifndef __GNUC_VA_LIST
428 #define __GNUC_VA_LIST
429 typedef __builtin_va_list __gnuc_va_list
;
432 #ifndef _VA_LIST_DEFINED
433 #define _VA_LIST_DEFINED
434 typedef __gnuc_va_list
va_list;
437 #ifdef _USE_32BIT_TIME_T
439 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
440 #undef _USE_32BIT_TIME_T
443 #if _INTEGRAL_MAX_BITS < 64
444 #define _USE_32BIT_TIME_T
448 #ifndef _ERRCODE_DEFINED
449 #define _ERRCODE_DEFINED
454 #ifndef _TIME32_T_DEFINED
455 #define _TIME32_T_DEFINED
456 typedef long __time32_t
;
459 #ifndef _TIME64_T_DEFINED
460 #define _TIME64_T_DEFINED
461 //#if _INTEGRAL_MAX_BITS >= 64
462 typedef __int64 __time64_t
;
466 #ifndef _TIME_T_DEFINED
467 #define _TIME_T_DEFINED
468 #ifdef _USE_32BIT_TIME_T
469 typedef __time32_t
time_t;
471 typedef __time64_t
time_t;
475 #ifndef _CONST_RETURN
476 #define _CONST_RETURN
479 #ifndef __CRT_UNALIGNED
480 #define __CRT_UNALIGNED
484 #if defined(__ia64__) || defined(__x86_64)
485 #define UNALIGNED __unaligned
492 #define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
504 #define __CRTDECL __cdecl
510 #define _TRUNCATE ((size_t)-1)
512 struct threadlocaleinfostruct
;
513 struct threadmbcinfostruct
;
514 typedef struct threadlocaleinfostruct
*pthreadlocinfo
;
515 typedef struct threadmbcinfostruct
*pthreadmbcinfo
;
516 struct __lc_time_data
;
518 typedef struct localeinfo_struct
{
519 pthreadlocinfo locinfo
;
520 pthreadmbcinfo mbcinfo
;
521 } _locale_tstruct
,*_locale_t
;
523 #ifndef _TAGLC_ID_DEFINED
524 #define _TAGLC_ID_DEFINED
525 typedef struct tagLC_ID
{
526 unsigned short wLanguage
;
527 unsigned short wCountry
;
528 unsigned short wCodePage
;
532 #ifndef _THREADLOCALEINFO
533 #define _THREADLOCALEINFO
534 typedef struct threadlocaleinfostruct
{
536 unsigned int lc_codepage
;
537 unsigned int lc_collate_cp
;
538 unsigned long lc_handle
[6];
548 int *lconv_intl_refcount
;
549 int *lconv_num_refcount
;
550 int *lconv_mon_refcount
;
552 int *ctype1_refcount
;
553 unsigned short *ctype1
;
554 const unsigned short *pctype
;
555 const unsigned char *pclmap
;
556 const unsigned char *pcumap
;
557 struct __lc_time_data
*lc_time_curr
;
565 #define __crt_typefix(ctype)
568 #define _CRT_UNUSED(x) (void)x