win32: add size_t to _mingw.h
[tinycc/kirr.git] / win32 / include / _mingw.h
blob14aae8b7a43820967cad8d367ea24d2afca0b1e3
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 #include <stddef.h>
23 #define __int64 long long
24 #define __int32 long
25 #define __int16 short
26 #define __int8 char
28 #define __cdecl __attribute__((__cdecl__))
29 #define __declspec(x) __attribute__((x))
30 #define __fastcall
32 // #define __MINGW_IMPORT extern __declspec(dllimport)
34 #undef _MSVCRT_
35 #undef __MINGW_IMPORT
37 #define _CRTIMP extern
38 #define __CRT_INLINE extern __inline__
39 #define __MINGW_NOTHROW
40 #define __MINGW_ATTRIB_NORETURN
41 #define __MINGW_ATTRIB_DEPRECATED
42 #define __GNUC_VA_LIST
44 #define _CONST_RETURN
45 #define _CRT_ALIGN(x) __attribute__((aligned(x)))
46 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
48 #define __CRT_STRINGIZE(_Value) #_Value
49 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
51 #define __CRT_WIDE(_String) L ## _String
52 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
54 #ifdef _WIN64
56 typedef __int64 intptr_t;
57 typedef unsigned __int64 uintptr_t;
58 #define __stdcall
59 #define _AMD64_ 1
60 #define __x86_64 1
61 #define USE_MINGW_SETJMP_TWO_ARGS
62 #define mingw_getsp tinyc_getbp
64 #else
66 typedef __int32 intptr_t;
67 typedef unsigned __int32 uintptr_t;
68 #define __stdcall __attribute__((__stdcall__))
69 #define _X86_ 1
70 #define WIN32 1
72 #endif
74 #define _INTEGRAL_MAX_BITS 64
75 #define _CRT_PACKING 8
77 typedef long __time32_t;
78 #define _TIME32_T_DEFINED
79 typedef __int64 __time64_t;
80 #define _TIME64_T_DEFINED
82 typedef unsigned long size_t;
83 #define _SIZE_T_DEFINED
84 typedef long ssize_t;
85 #define _SSIZE_T_DEFINED
87 #ifdef _USE_32BIT_TIME_T
88 #ifdef _WIN64
89 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
90 #endif
91 typedef __time32_t time_t;
92 #else
93 typedef __time64_t time_t;
94 #endif
95 #define _TIME_T_DEFINED
97 #define _WCTYPE_T_DEFINED
98 typedef unsigned int wint_t;
99 typedef unsigned short wctype_t;
101 #define _ERRCODE_DEFINED
102 typedef int errno_t;
104 typedef struct threadlocaleinfostruct *pthreadlocinfo;
105 typedef struct threadmbcinfostruct *pthreadmbcinfo;
106 typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
108 /* for winapi */
109 #define _ANONYMOUS_UNION
110 #define _ANONYMOUS_STRUCT
111 #define DECLSPEC_NORETURN
112 #define WIN32_LEAN_AND_MEAN
113 #define DECLARE_STDCALL_P(type) __stdcall type
114 #define NOSERVICE 1
115 #define NOMCX 1
116 #define NOIME 1
117 #ifndef WINVER
118 #define WINVER 0x0502
119 #endif
120 #ifndef _WIN32_WINNT
121 #define _WIN32_WINNT 0x502
122 #endif
124 /* get va_list */
125 #include <stdarg.h>
127 #endif /* __MINGW_H */