00ff2fcd563922c9a34cf88600ead595ed7d6f22
[tinycc.git] / win32 / include / _mingw.h
blob00ff2fcd563922c9a34cf88600ead595ed7d6f22
1 /*
2 * _mingw.h
4 * This file is for TinyCC and not part of the Mingw32 package.
6 * THIS SOFTWARE IS NOT COPYRIGHTED
8 * This source code is offered for use in the public domain. You may
9 * use, modify or distribute it freely.
11 * This code is distributed in the hope that it will be useful but
12 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
13 * DISCLAIMED. This includes but is not limited to warranties of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 #ifndef __MINGW_H
19 #define __MINGW_H
21 /* some winapi files define these before including _mingw.h --> */
22 #undef NULL
23 #undef __cdecl
24 #undef _X86_
25 #undef WIN32
26 /* <-- */
28 #include <stddef.h>
29 #include <stdarg.h>
31 #define __int8 char
32 #define __int16 short
33 #define __int32 int
34 #define __int64 long long
36 #define __cdecl __attribute__((__cdecl__))
37 #define __declspec(x) __attribute__((x))
38 #define __unaligned __attribute__((packed))
39 #define __fastcall __attribute__((fastcall))
41 #define __MINGW_IMPORT extern __declspec(dllimport)
42 #undef _MSVCRT_
43 #define __MINGW_ATTRIB_NORETURN
44 #define __MINGW_ATTRIB_CONST
45 #define __MINGW_ATTRIB_DEPRECATED
46 #define __MINGW_ATTRIB_MALLOC
47 #define __MINGW_ATTRIB_PURE
48 #define __MINGW_ATTRIB_NONNULL(arg)
49 #define __MINGW_NOTHROW
50 #define __GNUC_VA_LIST
52 #define _CRTIMP extern
53 #define __CRT_INLINE extern __inline__
55 #define _CRT_ALIGN(x) __attribute__((aligned(x)))
56 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
57 #define _CRT_PACKING 8
58 #define __CRT_UNALIGNED
59 #define _CONST_RETURN
61 #define __CRT_STRINGIZE(_Value) #_Value
62 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
63 #define __CRT_WIDE(_String) L ## _String
64 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
66 #ifdef _WIN64
67 #define __stdcall
68 #define _AMD64_ 1
69 #define __x86_64 1
70 #define USE_MINGW_SETJMP_TWO_ARGS
71 #define mingw_getsp tinyc_getbp
72 #define __TRY__
73 #else
74 #define __stdcall __attribute__((__stdcall__))
75 #define _X86_ 1
76 #define WIN32 1
77 #define _USE_32BIT_TIME_T
78 #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
79 #endif
81 /* in stddef.h */
82 #define _SIZE_T_DEFINED
83 #define _SSIZE_T_DEFINED
84 #define _PTRDIFF_T_DEFINED
85 #define _WCHAR_T_DEFINED
86 #define _UINTPTR_T_DEFINED
87 #define _INTPTR_T_DEFINED
89 #define _INTEGRAL_MAX_BITS 64
91 typedef long __time32_t;
92 #define _TIME32_T_DEFINED
93 typedef __int64 __time64_t;
94 #define _TIME64_T_DEFINED
95 #ifdef _USE_32BIT_TIME_T
96 typedef __time32_t time_t;
97 #define _TIME_T_DEFINED
98 #else
99 typedef __time64_t time_t;
100 #define _TIME_T_DEFINED
101 #endif
103 typedef unsigned long size_t;
104 #define _SIZE_T_DEFINED
105 typedef long ssize_t;
106 #define _SSIZE_T_DEFINED
108 typedef unsigned int wint_t;
109 typedef unsigned short wctype_t;
110 #define _WCTYPE_T_DEFINED
111 typedef unsigned short wchar_t;
112 #define _WCHAR_T_DEFINED
114 typedef int errno_t;
115 #define _ERRCODE_DEFINED
117 typedef struct threadlocaleinfostruct *pthreadlocinfo;
118 typedef struct threadmbcinfostruct *pthreadmbcinfo;
119 typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
121 /* for winapi */
122 #define _ANONYMOUS_UNION
123 #define _ANONYMOUS_STRUCT
124 #define DECLSPEC_NORETURN
125 #define DECLARE_STDCALL_P(type) __stdcall type
126 #define NOSERVICE 1
127 #define NOMCX 1
128 #define NOIME 1
129 #ifndef WIN32_LEAN_AND_MEAN
130 # define WIN32_LEAN_AND_MEAN 1
131 #endif
132 #ifndef WINVER
133 # define WINVER 0x0502
134 #endif
135 #ifndef _WIN32_WINNT
136 # define _WIN32_WINNT 0x502
137 #endif
139 #endif /* __MINGW_H */