win32: _mingw.h: do not undef NULL
[tinycc.git] / win32 / include / _mingw.h
blob0d2f03950b7496a27efcde36876e0e15f3a80a48
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 __cdecl
23 #undef _X86_
24 #undef WIN32
25 /* <-- */
27 #include <stddef.h>
28 #include <stdarg.h>
30 #define __int8 char
31 #define __int16 short
32 #define __int32 int
33 #define __int64 long long
35 #define __cdecl __attribute__((__cdecl__))
36 #define __declspec(x) __attribute__((x))
37 #define __unaligned __attribute__((packed))
38 #define __fastcall __attribute__((fastcall))
40 #define __MINGW_IMPORT extern __declspec(dllimport)
41 #undef _MSVCRT_
42 #define __MINGW_ATTRIB_NORETURN
43 #define __MINGW_ATTRIB_CONST
44 #define __MINGW_ATTRIB_DEPRECATED
45 #define __MINGW_ATTRIB_MALLOC
46 #define __MINGW_ATTRIB_PURE
47 #define __MINGW_ATTRIB_NONNULL(arg)
48 #define __MINGW_NOTHROW
49 #define __GNUC_VA_LIST
51 #define _CRTIMP extern
52 #define __CRT_INLINE extern __inline__
54 #define _CRT_ALIGN(x) __attribute__((aligned(x)))
55 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
56 #define _CRT_PACKING 8
57 #define __CRT_UNALIGNED
58 #define _CONST_RETURN
60 #define __CRT_STRINGIZE(_Value) #_Value
61 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
62 #define __CRT_WIDE(_String) L ## _String
63 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
65 #ifdef _WIN64
66 #define __stdcall
67 #define _AMD64_ 1
68 #define __x86_64 1
69 #define USE_MINGW_SETJMP_TWO_ARGS
70 #define mingw_getsp tinyc_getbp
71 #define __TRY__
72 #else
73 #define __stdcall __attribute__((__stdcall__))
74 #define _X86_ 1
75 #define WIN32 1
76 #define _USE_32BIT_TIME_T
77 #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
78 #endif
80 /* in stddef.h */
81 #define _SIZE_T_DEFINED
82 #define _SSIZE_T_DEFINED
83 #define _PTRDIFF_T_DEFINED
84 #define _WCHAR_T_DEFINED
85 #define _UINTPTR_T_DEFINED
86 #define _INTPTR_T_DEFINED
88 #define _INTEGRAL_MAX_BITS 64
90 typedef long __time32_t;
91 #define _TIME32_T_DEFINED
92 typedef __int64 __time64_t;
93 #define _TIME64_T_DEFINED
94 #ifdef _USE_32BIT_TIME_T
95 typedef __time32_t time_t;
96 #define _TIME_T_DEFINED
97 #else
98 typedef __time64_t time_t;
99 #define _TIME_T_DEFINED
100 #endif
102 typedef unsigned long size_t;
103 #define _SIZE_T_DEFINED
104 typedef long ssize_t;
105 #define _SSIZE_T_DEFINED
107 typedef unsigned int wint_t;
108 typedef unsigned short wctype_t;
109 #define _WCTYPE_T_DEFINED
110 typedef unsigned short wchar_t;
111 #define _WCHAR_T_DEFINED
113 typedef int errno_t;
114 #define _ERRCODE_DEFINED
116 typedef struct threadlocaleinfostruct *pthreadlocinfo;
117 typedef struct threadmbcinfostruct *pthreadmbcinfo;
118 typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
120 /* for winapi */
121 #define _ANONYMOUS_UNION
122 #define _ANONYMOUS_STRUCT
123 #define DECLSPEC_NORETURN
124 #define DECLARE_STDCALL_P(type) __stdcall type
125 #define NOSERVICE 1
126 #define NOMCX 1
127 #define NOIME 1
128 #ifndef WIN32_LEAN_AND_MEAN
129 # define WIN32_LEAN_AND_MEAN 1
130 #endif
131 #ifndef WINVER
132 # define WINVER 0x0502
133 #endif
134 #ifndef _WIN32_WINNT
135 # define _WIN32_WINNT 0x502
136 #endif
138 #endif /* __MINGW_H */