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.PD within this package.
10
#include "_mingw_mac.h"
12
/* C/C++ specific language defines. */
21
# ifndef __MINGW_IMPORT
22
# define __MINGW_IMPORT __declspec(dllimport)
25
# define _CRTIMP __declspec(dllimport)
27
# define __DECLSPEC_SUPPORTED
28
# define __attribute__(x) /* nothing */
31
# ifndef __MINGW_IMPORT
32
/* Note the extern. This is needed to work around GCC's
33
limitations in handling dllimport attribute. */
34
# define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
38
# if !defined (_CRTBLD) && !defined (_SYSCRT)
39
# define __USE_CRTIMP 1
42
# define _CRTIMP __attribute__ ((__dllimport__))
47
# define __DECLSPEC_SUPPORTED
48
# else /* __declspec */
49
# undef __DECLSPEC_SUPPORTED
50
# undef __MINGW_IMPORT
54
# endif /* __declspec */
57
#if defined (__GNUC__) && defined (__GNUC_MINOR__)
58
#define __MINGW_GNUC_PREREQ(major, minor) \
60
|| (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
62
#define __MINGW_GNUC_PREREQ(major, minor) 0
65
#if defined (_MSC_VER)
66
#define __MINGW_MSC_PREREQ(major, minor) \
67
(_MSC_VER >= (major * 100 + minor * 10))
69
#define __MINGW_MSC_PREREQ(major, minor) 0
72
#define USE___UUIDOF 0
75
# define __CRT_INLINE inline
76
#elif defined(_MSC_VER)
77
# define __CRT_INLINE __inline
79
# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
80
# define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
82
# define __CRT_INLINE extern __inline__
87
#undef __CRT__NO_INLINE
88
#define __CRT__NO_INLINE 1
92
# define __UNUSED_PARAM(x)
95
# define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
97
# define __UNUSED_PARAM(x) x
103
# define __restrict__ __restrict
105
# define __restrict__ /* nothing */
107
#endif /* !__GNUC__ */
110
#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
111
#define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
112
#elif __MINGW_MSC_PREREQ(12, 0)
113
#define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
114
#define __MINGW_ATTRIB_CONST
116
#define __MINGW_ATTRIB_NORETURN
117
#define __MINGW_ATTRIB_CONST
120
#if __MINGW_GNUC_PREREQ (3, 0)
121
#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
122
#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
123
#elif __MINGW_MSC_PREREQ(14, 0)
124
#define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
125
#define __MINGW_ATTRIB_PURE
127
#define __MINGW_ATTRIB_MALLOC
128
#define __MINGW_ATTRIB_PURE
131
/* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
132
variadiac macro facility, because variadic macros cause syntax
133
errors with --traditional-cpp. */
134
#if __MINGW_GNUC_PREREQ (3, 3)
135
#define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
137
#define __MINGW_ATTRIB_NONNULL(arg)
138
#endif /* GNUC >= 3.3 */
141
#define __MINGW_ATTRIB_UNUSED __attribute__ ((__unused__))
143
#define __MINGW_ATTRIB_UNUSED
144
#endif /* ATTRIBUTE_UNUSED */
146
#if __MINGW_GNUC_PREREQ (3, 1)
147
#define __MINGW_ATTRIB_USED __attribute__ ((__used__))
148
#define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
149
#elif __MINGW_MSC_PREREQ(12, 0)
150
#define __MINGW_ATTRIB_USED
151
#define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
153
#define __MINGW_ATTRIB_USED __MINGW_ATTRIB_UNUSED
154
#define __MINGW_ATTRIB_DEPRECATED
155
#endif /* GNUC >= 3.1 */
157
#if __MINGW_GNUC_PREREQ (3, 3)
158
#define __MINGW_NOTHROW __attribute__ ((__nothrow__))
159
#elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
160
#define __MINGW_NOTHROW __declspec(nothrow)
162
#define __MINGW_NOTHROW
165
#if __MINGW_GNUC_PREREQ (4, 4)
166
#define __MINGW_ATTRIB_NO_OPTIMIZE __attribute__((__optimize__ ("0")))
168
#define __MINGW_ATTRIB_NO_OPTIMIZE
171
#ifndef __MSVCRT_VERSION__
172
/* High byte is the major version, low byte is the minor. */
173
# define __MSVCRT_VERSION__ 0x0700
178
#define WINVER 0x0502
182
#define _WIN32_WINNT 0x502
185
#ifndef _INT128_DEFINED
186
#define _INT128_DEFINED
189
#define __int16 short
191
#define __int64 long long
193
#ifndef __SIZEOF_INT128__
194
typedef int __int128 __attribute__ ((__mode__ (TI)));
197
#endif /* __GNUC__ */
198
#endif /* _INT128_DEFINED */
206
#define __forceinline extern __inline__ __attribute__((always_inline))
207
#endif /* __GNUC__ */
210
#error Only Win32 target is supported!
215
#define __nothrow __declspec(nothrow)
219
#endif /* __nothrow */
222
#define _CRT_PACKING 8
224
#include <vadefs.h> /* other headers depend on this include */
226
#pragma pack(push,_CRT_PACKING)
228
#ifndef _CRT_STRINGIZE
229
#define __CRT_STRINGIZE(_Value) #_Value
230
#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
231
#endif /* _CRT_STRINGIZE */
234
#define __CRT_WIDE(_String) L ## _String
235
#define _CRT_WIDE(_String) __CRT_WIDE(_String)
236
#endif /* _CRT_WIDE */
242
#ifndef _CRTIMP_NOIA64
244
#define _CRTIMP_NOIA64
246
#define _CRTIMP_NOIA64 _CRTIMP
248
#endif /* _CRTIMP_NOIA64 */
251
#define _CRTIMP2 _CRTIMP
254
#ifndef _CRTIMP_ALTERNATIVE
255
#define _CRTIMP_ALTERNATIVE _CRTIMP
256
#define _CRT_ALTERNATIVE_IMPORTED
257
#endif /* _CRTIMP_ALTERNATIVE */
260
#define _MRTIMP2 _CRTIMP
263
/* We have to define _DLL for gcc based mingw version. This define is set
264
by VC, when DLL-based runtime is used. So, gcc based runtime just have
265
DLL-base runtime, therefore this define has to be set.
266
As our headers are possibly used by windows compiler having a static
267
C-runtime, we make this definition gnu compiler specific here. */
268
#if !defined (_DLL) && defined (__GNUC__)
277
#define _MCRTIMP _CRTIMP
281
#define _CRTIMP_PURE _CRTIMP
292
#define __STDC_SECURE_LIB__ 200411L
293
#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
294
#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
295
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
297
#ifndef _CRT_INSECURE_DEPRECATE_MEMORY
298
#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
301
#ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
302
#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
305
#ifndef _CRT_MANAGED_HEAP_DEPRECATE
306
#define _CRT_MANAGED_HEAP_DEPRECATE
309
#ifndef _CRT_OBSOLETE
310
#define _CRT_OBSOLETE(_NewItem)
313
#ifndef _SIZE_T_DEFINED
314
#define _SIZE_T_DEFINED
317
__MINGW_EXTENSION typedef unsigned __int64 size_t;
319
typedef unsigned int size_t;
321
#endif /* _SIZE_T_DEFINED */
323
#ifndef _SSIZE_T_DEFINED
324
#define _SSIZE_T_DEFINED
327
__MINGW_EXTENSION typedef __int64 ssize_t;
331
#endif /* _SSIZE_T_DEFINED */
333
#ifndef _INTPTR_T_DEFINED
334
#define _INTPTR_T_DEFINED
335
#ifndef __intptr_t_defined
336
#define __intptr_t_defined
339
__MINGW_EXTENSION typedef __int64 intptr_t;
341
typedef int intptr_t;
343
#endif /* __intptr_t_defined */
344
#endif /* _INTPTR_T_DEFINED */
346
#ifndef _UINTPTR_T_DEFINED
347
#define _UINTPTR_T_DEFINED
348
#ifndef __uintptr_t_defined
349
#define __uintptr_t_defined
352
__MINGW_EXTENSION typedef unsigned __int64 uintptr_t;
354
typedef unsigned int uintptr_t;
356
#endif /* __uintptr_t_defined */
357
#endif /* _UINTPTR_T_DEFINED */
359
#ifndef _PTRDIFF_T_DEFINED
360
#define _PTRDIFF_T_DEFINED
365
__MINGW_EXTENSION typedef __int64 ptrdiff_t;
367
typedef int ptrdiff_t;
369
#endif /* _PTRDIFF_T_ */
370
#endif /* _PTRDIFF_T_DEFINED */
372
#ifndef _WCHAR_T_DEFINED
373
#define _WCHAR_T_DEFINED
375
typedef unsigned short wchar_t;
377
#endif /* _WCHAR_T_DEFINED */
379
#ifndef _WCTYPE_T_DEFINED
380
#define _WCTYPE_T_DEFINED
383
typedef unsigned short wint_t;
384
typedef unsigned short wctype_t;
386
#endif /* _WCTYPE_T_DEFINED */
388
#if defined (_WIN32) && !defined (_WIN64) && !defined (__MINGW_USE_VC2005_COMPAT)
389
#ifndef _USE_32BIT_TIME_T
390
#define _USE_32BIT_TIME_T
394
#ifdef _USE_32BIT_TIME_T
396
#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
397
#undef _USE_32BIT_TIME_T
399
#endif /* _USE_32BIT_TIME_T */
401
#ifndef _ERRCODE_DEFINED
402
#define _ERRCODE_DEFINED
406
#ifndef _TIME32_T_DEFINED
407
#define _TIME32_T_DEFINED
408
typedef long __time32_t;
411
#ifndef _TIME64_T_DEFINED
412
#define _TIME64_T_DEFINED
413
__MINGW_EXTENSION typedef __int64 __time64_t;
414
#endif /* _TIME64_T_DEFINED */
416
#ifndef _TIME_T_DEFINED
417
#define _TIME_T_DEFINED
418
#ifdef _USE_32BIT_TIME_T
419
typedef __time32_t time_t;
421
typedef __time64_t time_t;
423
#endif /* _TIME_T_DEFINED */
425
#ifndef _CONST_RETURN
426
#define _CONST_RETURN
430
#if defined(_M_IA64) || defined(_M_AMD64)
431
#define UNALIGNED __unaligned
435
#endif /* UNALIGNED */
439
#define _CRT_ALIGN(x) __declspec(align(x))
441
#define _CRT_ALIGN(x) __attribute__ ((__aligned__ (x)))
443
#endif /* _CRT_ALIGN */
446
#define __CRTDECL __cdecl
452
#define _TRUNCATE ((size_t)-1)
456
#define _CRT_UNUSED(x) (void)x
459
#if defined(_POSIX) && !defined(__USE_MINGW_ANSI_STDIO)
460
/* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
461
* and If user did _not_ specify it explicitly... */
462
# define __USE_MINGW_ANSI_STDIO 1
465
/* _dowildcard is an int that controls the globbing of the command line.
466
* The MinGW32 (mingw.org) runtime calls it _CRT_glob, so we are adding
467
* a compatibility definition here: you can use either of _CRT_glob or
469
* If _dowildcard is non-zero, the command line will be globbed: *.*
470
* will be expanded to be all files in the startup directory.
471
* In the mingw-w64 library a _dowildcard variable is defined as being
472
* 0, therefore command line globbing is DISABLED by default. To turn it
473
* on and to leave wildcard command line processing MS's globbing code,
474
* include a line in one of your source modules defining _dowildcard and
475
* setting it to -1, like so:
476
* int _dowildcard = -1;
479
#define _CRT_glob _dowildcard
482
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
483
#define NONAMELESSUNION 1
485
#if defined(NONAMELESSSTRUCT) && \
486
!defined(NONAMELESSUNION)
487
#define NONAMELESSUNION 1
489
#if defined(NONAMELESSUNION) && \
490
!defined(NONAMELESSSTRUCT)
491
#define NONAMELESSSTRUCT 1
494
#ifndef __ANONYMOUS_DEFINED
495
#define __ANONYMOUS_DEFINED
496
#define _ANONYMOUS_UNION __MINGW_EXTENSION
497
#define _ANONYMOUS_STRUCT __MINGW_EXTENSION
498
#ifndef NONAMELESSUNION
499
#define _UNION_NAME(x)
500
#define _STRUCT_NAME(x)
501
#else /* NONAMELESSUNION */
502
#define _UNION_NAME(x) x
503
#define _STRUCT_NAME(x) x
505
#endif /* __ANONYMOUS_DEFINED */
507
#ifndef DUMMYUNIONNAME
508
# ifdef NONAMELESSUNION
509
# define DUMMYUNIONNAME u
510
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
511
# define DUMMYUNIONNAME2 u2
512
# define DUMMYUNIONNAME3 u3
513
# define DUMMYUNIONNAME4 u4
514
# define DUMMYUNIONNAME5 u5
515
# define DUMMYUNIONNAME6 u6
516
# define DUMMYUNIONNAME7 u7
517
# define DUMMYUNIONNAME8 u8
518
# define DUMMYUNIONNAME9 u9
519
# else /* NONAMELESSUNION */
520
# define DUMMYUNIONNAME
521
# define DUMMYUNIONNAME1 /* Wine uses this variant */
522
# define DUMMYUNIONNAME2
523
# define DUMMYUNIONNAME3
524
# define DUMMYUNIONNAME4
525
# define DUMMYUNIONNAME5
526
# define DUMMYUNIONNAME6
527
# define DUMMYUNIONNAME7
528
# define DUMMYUNIONNAME8
529
# define DUMMYUNIONNAME9
531
#endif /* DUMMYUNIONNAME */
533
#ifndef DUMMYSTRUCTNAME
534
# ifdef NONAMELESSUNION
535
# define DUMMYSTRUCTNAME s
536
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
537
# define DUMMYSTRUCTNAME2 s2
538
# define DUMMYSTRUCTNAME3 s3
539
# define DUMMYSTRUCTNAME4 s4
540
# define DUMMYSTRUCTNAME5 s5
542
# define DUMMYSTRUCTNAME
543
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
544
# define DUMMYSTRUCTNAME2
545
# define DUMMYSTRUCTNAME3
546
# define DUMMYSTRUCTNAME4
547
# define DUMMYSTRUCTNAME5
549
#endif /* DUMMYSTRUCTNAME */
554
struct threadlocaleinfostruct;
555
struct threadmbcinfostruct;
556
typedef struct threadlocaleinfostruct *pthreadlocinfo;
557
typedef struct threadmbcinfostruct *pthreadmbcinfo;
558
struct __lc_time_data;
560
typedef struct localeinfo_struct {
561
pthreadlocinfo locinfo;
562
pthreadmbcinfo mbcinfo;
563
} _locale_tstruct,*_locale_t;
565
#ifndef _TAGLC_ID_DEFINED
566
#define _TAGLC_ID_DEFINED
567
typedef struct tagLC_ID {
568
unsigned short wLanguage;
569
unsigned short wCountry;
570
unsigned short wCodePage;
572
#endif /* _TAGLC_ID_DEFINED */
574
#ifndef _THREADLOCALEINFO
575
#define _THREADLOCALEINFO
576
typedef struct threadlocaleinfostruct {
578
unsigned int lc_codepage;
579
unsigned int lc_collate_cp;
580
unsigned long lc_handle[6];
590
int *lconv_intl_refcount;
591
int *lconv_num_refcount;
592
int *lconv_mon_refcount;
594
int *ctype1_refcount;
595
unsigned short *ctype1;
596
const unsigned short *pctype;
597
const unsigned char *pclmap;
598
const unsigned char *pcumap;
599
struct __lc_time_data *lc_time_curr;
601
#endif /* _THREADLOCALEINFO */
607
/* mingw-w64 specific functions: */
608
const char *__mingw_get_crt_info (void);
616
#endif /* _INC_CRTDEFS */
618
#ifndef MINGW_SDK_INIT
619
#define MINGW_SDK_INIT
621
#include "sdks/_mingw_directx.h"
623
#endif /* MINGW_SDK_INIT */