win64: use new headers from mingw
[tinycc.git] / win32 / include / _mingw.h
blob295b689fce12ae38279110606771a59f4d2141b8
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
55 typedef __int64 intptr_t;
56 typedef unsigned __int64 uintptr_t;
57 #define __stdcall
58 #define _AMD64_ 1
59 #define __x86_64 1
60 #else
61 typedef __int32 intptr_t;
62 typedef unsigned __int32 uintptr_t;
63 #define __stdcall __attribute__((__stdcall__))
64 #define _X86_ 1
65 #define WIN32 1
66 #endif
68 #define _INTEGRAL_MAX_BITS 64
69 #define _CRT_PACKING 8
71 typedef long __time32_t;
72 #define _TIME32_T_DEFINED
73 typedef __int64 __time64_t;
74 #define _TIME64_T_DEFINED
76 #ifdef _USE_32BIT_TIME_T
77 #ifdef _WIN64
78 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
79 #endif
80 typedef __time32_t time_t;
81 #else
82 typedef __time64_t time_t;
83 #endif
84 #define _TIME_T_DEFINED
86 #define _WCTYPE_T_DEFINED
87 typedef unsigned int wint_t;
88 typedef unsigned short wctype_t;
90 #define _ERRCODE_DEFINED
91 typedef int errno_t;
93 typedef struct threadlocaleinfostruct *pthreadlocinfo;
94 typedef struct threadmbcinfostruct *pthreadmbcinfo;
95 typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
97 /* for winapi */
98 #define _ANONYMOUS_UNION
99 #define _ANONYMOUS_STRUCT
100 #define DECLSPEC_NORETURN
101 #define WIN32_LEAN_AND_MEAN
102 #define DECLARE_STDCALL_P(type) __stdcall type
103 #define NOSERVICE 1
104 #define NOMCX 1
105 #define NOIME 1
106 #ifndef WINVER
107 #define WINVER 0x0502
108 #endif
109 #ifndef _WIN32_WINNT
110 #define _WIN32_WINNT 0x502
111 #endif
113 /* get va_list */
114 #include <stdarg.h>
116 #endif /* __MINGW_H */