modified dll/win32/srclient/srclient_main.c
[reactos.git] / reactos / include / crt / _mingw.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6
7 #ifndef _INC_MINGW
8 #define _INC_MINGW
9
10 #define _INTEGRAL_MAX_BITS 64
11
12 #ifndef MINGW64
13 #define MINGW64
14 #define MINGW64_VERSION 1.0
15 #define MINGW64_VERSION_MAJOR 1
16 #define MINGW64_VERSION_MINOR 0
17 #define MINGW64_VERSION_STATE "alpha"
18 #endif
19
20 #ifdef _WIN64
21 #ifdef __stdcall
22 #undef __stdcall
23 #endif
24 #define __stdcall
25 #endif
26
27 #ifdef __GNUC__
28 /* These compilers do support __declspec */
29 # if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__CYGWIN32__)
30 # define __declspec(x) __attribute__((x))
31 # endif
32 #else
33 # define __attribute__(x) /* nothing */
34 #endif
35
36 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
37 #define __MINGW_GNUC_PREREQ(major, minor) \
38 (__GNUC__ > (major) \
39 || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
40 #else
41 #define __MINGW_GNUC_PREREQ(major, minor) 0
42 #endif
43
44 #if defined (_MSC_VER)
45 #define __MINGW_MSC_PREREQ(major, minor) ((major * 100 + minor * 10) >= _MSC_VER)
46 #else
47 #define __MINGW_MSC_PREREQ(major, minor) 0
48 #endif
49
50 #define USE___UUIDOF 0
51
52 #ifdef __cplusplus
53 # define __CRT_INLINE inline
54 #elif defined(_MSC_VER)
55 # define __CRT_INLINE __inline
56 #elif defined(__GNUC__)
57 # if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
58 # define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
59 # else
60 # define __CRT_INLINE extern __inline__ __attribute__((__always_inline__))
61 # endif
62 #endif
63
64 #ifdef __cplusplus
65 # define __UNUSED_PARAM(x)
66 #else
67 # ifdef __GNUC__
68 # define __UNUSED_PARAM(x) x __attribute__ ((__unused__))
69 # else
70 # define __UNUSED_PARAM(x) x
71 # endif
72 #endif
73
74 #ifdef __cplusplus
75 # define __unaligned
76 #else
77 # ifdef __GNUC__
78 # define __unaligned __attribute((packed))
79 # elif defined(_MSC_VER) && !defined(_M_IA64) && !defined(_M_AMD64)
80 # define __unaligned
81 # else
82 # define __unaligned
83 # endif
84 #endif
85
86 #ifdef __GNUC__
87 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
88 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
89 #elif __MINGW_MSC_PREREQ(12, 0)
90 #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
91 #define __MINGW_ATTRIB_CONST
92 #else
93 #define __MINGW_ATTRIB_NORETURN
94 #define __MINGW_ATTRIB_CONST
95 #endif
96
97 #if __MINGW_GNUC_PREREQ (3, 0)
98 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
99 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
100 #elif __MINGW_MSC_PREREQ(14, 0)
101 #define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
102 #define __MINGW_ATTRIB_PURE
103 #else
104 #define __MINGW_ATTRIB_MALLOC
105 #define __MINGW_ATTRIB_PURE
106 #endif
107
108 /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
109 variadiac macro facility, because variadic macros cause syntax
110 errors with --traditional-cpp. */
111 #if __MINGW_GNUC_PREREQ (3, 3)
112 #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
113 #else
114 #define __MINGW_ATTRIB_NONNULL(arg)
115 #endif /* GNUC >= 3.3 */
116
117 #if __MINGW_GNUC_PREREQ (3, 1)
118 #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
119 #elif __MINGW_MSC_PREREQ(12, 0)
120 #define __MINGW_ATTRIB_DEPRECATED __declspec(deprecated)
121 #else
122 #define __MINGW_ATTRIB_DEPRECATED
123 #endif
124
125 #if __MINGW_GNUC_PREREQ (3, 3)
126 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
127 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
128 #define __MINGW_NOTHROW __declspec(nothrow)
129 #else
130 #define __MINGW_NOTHROW
131 #endif
132
133 /* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
134 allow GCC to optimize away some EH unwind code, at least in DW2 case. */
135
136 #ifndef __MSVCRT_VERSION__
137 /* High byte is the major version, low byte is the minor. */
138 # define __MSVCRT_VERSION__ 0x0700
139 #endif
140
141 //#ifndef WINVER
142 //#define WINVER 0x0502
143 //#endif
144
145 //#ifndef _WIN32_WINNT
146 //#define _WIN32_WINNT 0x502
147 //#endif
148
149 #ifdef __GNUC__
150 #define __int8 char
151 #define __int16 short
152 #define __int32 int
153 #define __int64 long long
154 #ifdef _WIN64
155 typedef int __int128 __attribute__ ((mode (TI)));
156 # endif
157 # define __ptr32
158 # define __ptr64
159 # define __forceinline extern __inline __attribute((always_inline))
160 #endif
161
162 #ifdef __cplusplus
163 #ifndef __nothrow
164 #define __nothrow __declspec(nothrow)
165 #endif
166 #else
167 #ifndef __nothrow
168 #define __nothrow
169 #endif
170 #endif
171
172 #ifdef _WIN64
173 #undef USE_MINGW_SETJMP_TWO_ARGS
174 #define USE_MINGW_SETJMP_TWO_ARGS
175 #endif
176
177 /* Diable deprecation for now! */
178 #define _CRT_SECURE_NO_DEPRECATE
179 #define _CRT_SECURE_NO_DEPRECATE_CORE
180 #ifdef __WINESRC__
181 #define _CRT_NONSTDC_NO_DEPRECATE
182 #endif
183
184 #define __crt_typefix(ctype)
185
186 #ifndef _CRT_UNUSED
187 #define _CRT_UNUSED(x) (void)x
188 #endif
189
190 #endif /* !_INC_MINGW */
191