win32: cleanup include
[tinycc/kirr.git] / win32 / include / _mingw.h
blob04fc1cadf2d9f4afe21c58f28fe7c6596907915a
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>
22 #include <stdarg.h>
24 #define __int8 char
25 #define __int16 short
26 #define __int32 int
27 #define __int64 long long
29 #define __cdecl __attribute__((__cdecl__))
30 #define __declspec(x) __attribute__((x))
31 #define __unaligned __attribute__((packed))
32 #define __fastcall __attribute__((fastcall))
34 // #define __MINGW_IMPORT extern __declspec(dllimport)
35 #undef _MSVCRT_
36 #undef __MINGW_IMPORT
37 #define __MINGW_ATTRIB_NORETURN
38 #define __MINGW_ATTRIB_CONST
39 #define __MINGW_ATTRIB_DEPRECATED
40 #define __MINGW_ATTRIB_MALLOC
41 #define __MINGW_ATTRIB_PURE
42 #define __MINGW_ATTRIB_NONNULL(arg)
43 #define __MINGW_NOTHROW
44 #define __GNUC_VA_LIST
46 #define _CRTIMP extern
47 #define __CRT_INLINE extern __inline__
49 #define _CRT_ALIGN(x) __attribute__((aligned(x)))
50 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
51 #define _CRT_PACKING 8
52 #define __CRT_UNALIGNED
53 #define _CONST_RETURN
55 #define __CRT_STRINGIZE(_Value) #_Value
56 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
57 #define __CRT_WIDE(_String) L ## _String
58 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
60 #ifdef _WIN64
61 # define _INTEGRAL_MAX_BITS 64
62 typedef __int64 intptr_t;
63 typedef __int64 ptrdiff_t;
64 typedef unsigned __int64 uintptr_t;
65 # define __stdcall
66 # define _AMD64_ 1
67 # define __x86_64 1
68 # define USE_MINGW_SETJMP_TWO_ARGS
69 # define mingw_getsp tinyc_getbp
70 #else
71 # define _INTEGRAL_MAX_BITS 32
72 typedef __int32 intptr_t;
73 typedef __int32 ptrdiff_t;
74 typedef unsigned __int32 uintptr_t;
75 # define __stdcall __attribute__((__stdcall__))
76 # define _X86_ 1
77 # define WIN32 1
78 # define _USE_32BIT_TIME_T
79 #endif
80 #define _UINTPTR_T_DEFINED
81 #define _INTPTR_T_DEFINED
82 #define _PTRDIFF_T_DEFINED
84 typedef long __time32_t;
85 #define _TIME32_T_DEFINED
86 typedef __int64 __time64_t;
87 #define _TIME64_T_DEFINED
88 #ifdef _USE_32BIT_TIME_T
89 typedef __time32_t time_t;
90 #define _TIME_T_DEFINED
91 #else
92 typedef __time64_t time_t;
93 #define _TIME_T_DEFINED
94 #endif
96 typedef unsigned long size_t;
97 #define _SIZE_T_DEFINED
98 typedef long ssize_t;
99 #define _SSIZE_T_DEFINED
101 typedef unsigned int wint_t;
102 typedef unsigned short wctype_t;
103 #define _WCTYPE_T_DEFINED
104 typedef unsigned short wchar_t;
105 #define _WCHAR_T_DEFINED
107 typedef int errno_t;
108 #define _ERRCODE_DEFINED
110 typedef struct threadlocaleinfostruct *pthreadlocinfo;
111 typedef struct threadmbcinfostruct *pthreadmbcinfo;
112 typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
114 /* for winapi */
115 #define WIN32_LEAN_AND_MEAN
116 #define NOSERVICE 1
117 #define NOMCX 1
118 #define NOIME 1
119 #ifndef WINVER
120 # define WINVER 0x0502
121 #endif
122 #ifndef _WIN32_WINNT
123 # define _WIN32_WINNT 0x502
124 #endif
126 #endif /* __MINGW_H */