4 #pragma GCC system_header
14 * If you need Win32 API features newer the Win95 and WinNT then you must
15 * define WINVER before including windows.h or any other method of including
16 * the windef.h header.
20 #define _WIN32_WINNT WINVER
22 * There may be the need to define _WIN32_WINNT to a value different from
23 * the value of WINVER. I don't have any example of why you would do that.
24 * However, if you must then define _WIN32_WINNT to the value required before
25 * including windows.h or any other method of including the windef.h header.
48 #define NULL ((void*)0)
58 /* Pseudo modifiers for parameters
59 We don't use these unnecessary defines in the w32api headers. Define
60 them by default since that is what people expect, but allow users
61 to avoid the pollution. */
62 #ifndef _NO_W32_PSEUDO_MODIFIERS
72 #define _fastcall __attribute__((fastcall))
75 #define __fastcall __attribute__((fastcall))
78 #define _stdcall __attribute__((stdcall))
81 #define __stdcall __attribute__((stdcall))
84 #define _cdecl __attribute__((cdecl))
87 #define __cdecl __attribute__((cdecl))
90 #define __declspec(e) __attribute__((e))
93 #define _declspec(e) __attribute__((e))
103 #define pascal __stdcall
104 #define _pascal __stdcall
105 #define __pascal __stdcall
106 #define PASCAL _pascal
108 #define STDCALL __stdcall
109 #define FASTCALL __fastcall
110 #define WINAPI __stdcall
111 #define WINAPIV __cdecl
112 #define APIENTRY __stdcall
113 #define CALLBACK __stdcall
114 #define APIPRIVATE __stdcall
116 #define DECLSPEC_IMPORT __declspec(dllimport)
117 #define DECLSPEC_EXPORT __declspec(dllexport)
119 #define DECLSPEC_NORETURN __declspec(noreturn)
120 #define DECLARE_STDCALL_P( type ) __stdcall type
121 #elif defined(__WATCOMC__)
122 #define DECLSPEC_NORETURN
123 #define DECLARE_STDCALL_P( type ) type __stdcall
124 #endif /* __GNUC__/__WATCOMC__ */
125 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
126 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
127 #define LOWORD(l) ((WORD)((DWORD)(l)))
128 #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
129 #define LOBYTE(w) ((BYTE)(w))
130 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
143 #define max(a,b) ((a)>(b)?(a):(b))
146 #define min(a,b) ((a)<(b)?(a):(b))
150 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
151 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
152 #define DBG_UNREFERENCED_PARAMETER(P)
153 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
155 #ifndef NONAMELESSUNION
157 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
158 #define _ANONYMOUS_UNION __extension__
159 #define _ANONYMOUS_STRUCT __extension__
161 #if defined(__cplusplus)
162 #define _ANONYMOUS_UNION __extension__
163 #endif /* __cplusplus */
164 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
165 #elif defined(__WATCOMC__)
166 #define _ANONYMOUS_UNION
167 #define _ANONYMOUS_STRUCT
168 #endif /* __GNUC__/__WATCOMC__ */
169 #endif /* NONAMELESSUNION */
171 #ifndef _ANONYMOUS_UNION
172 #define _ANONYMOUS_UNION
173 #define _UNION_NAME(x) x
174 #define DUMMYUNIONNAME u
175 #define DUMMYUNIONNAME2 u2
176 #define DUMMYUNIONNAME3 u3
177 #define DUMMYUNIONNAME4 u4
178 #define DUMMYUNIONNAME5 u5
179 #define DUMMYUNIONNAME6 u6
180 #define DUMMYUNIONNAME7 u7
181 #define DUMMYUNIONNAME8 u8
183 #define _UNION_NAME(x)
184 #define DUMMYUNIONNAME
185 #define DUMMYUNIONNAME2
186 #define DUMMYUNIONNAME3
187 #define DUMMYUNIONNAME4
188 #define DUMMYUNIONNAME5
189 #define DUMMYUNIONNAME6
190 #define DUMMYUNIONNAME7
191 #define DUMMYUNIONNAME8
193 #ifndef _ANONYMOUS_STRUCT
194 #define _ANONYMOUS_STRUCT
195 #define _STRUCT_NAME(x) x
196 #define DUMMYSTRUCTNAME s
197 #define DUMMYSTRUCTNAME2 s2
198 #define DUMMYSTRUCTNAME3 s3
200 #define _STRUCT_NAME(x)
201 #define DUMMYSTRUCTNAME
202 #define DUMMYSTRUCTNAME2
203 #define DUMMYSTRUCTNAME3
212 /* FIXME: This will make some code compile. The programs will most
213 likely crash when an exception is raised, but at least they will
215 #if defined (__GNUC__) && defined (__SEH_NOOP)
217 #define __except(x) if (0) /* don't execute handler */
221 #define _except __except
222 #define _finally __finally
225 typedef unsigned long DWORD;
226 typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
227 /* FIXME: Is there a good solution to this? */
228 #ifndef XFree86Server
230 typedef WINBOOL BOOL;
234 typedef unsigned char BYTE;
235 #endif /* ndef XFree86Server */
236 typedef BOOL *PBOOL,*LPBOOL;
237 typedef unsigned short WORD;
239 typedef FLOAT *PFLOAT;
240 typedef BYTE *PBYTE,*LPBYTE;
241 typedef int *PINT,*LPINT;
242 typedef WORD *PWORD,*LPWORD;
243 typedef long *LPLONG;
244 typedef DWORD *PDWORD,*LPDWORD;
245 typedef CONST void *PCVOID,*LPCVOID;
247 typedef unsigned int UINT,*PUINT,*LPUINT;
251 typedef UINT_PTR WPARAM;
252 typedef LONG_PTR LPARAM;
253 typedef LONG_PTR LRESULT;
254 #ifndef _HRESULT_DEFINED
255 typedef LONG HRESULT;
256 #define _HRESULT_DEFINED
258 #ifndef XFree86Server
260 #endif /* XFree86Server */
261 typedef HANDLE HHOOK;
262 typedef HANDLE HGLOBAL;
263 typedef HANDLE HLOCAL;
264 typedef HANDLE GLOBALHANDLE;
265 typedef HANDLE LOCALHANDLE;
266 typedef void *HGDIOBJ;
267 DECLARE_HANDLE(HACCEL);
268 DECLARE_HANDLE(HBITMAP);
269 DECLARE_HANDLE(HBRUSH);
270 DECLARE_HANDLE(HCOLORSPACE);
272 DECLARE_HANDLE(HGLRC);
273 DECLARE_HANDLE(HDESK);
274 DECLARE_HANDLE(HENHMETAFILE);
275 DECLARE_HANDLE(HFONT);
276 DECLARE_HANDLE(HICON);
277 DECLARE_HANDLE(HKEY);
278 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
279 DECLARE_HANDLE(HMONITOR);
280 #define HMONITOR_DECLARED 1
281 DECLARE_HANDLE(HTERMINAL);
282 DECLARE_HANDLE(HWINEVENTHOOK);
285 DECLARE_HANDLE(HMENU);
286 DECLARE_HANDLE(HMETAFILE);
287 DECLARE_HANDLE(HINSTANCE);
288 typedef HINSTANCE HMODULE;
289 DECLARE_HANDLE(HPALETTE);
290 DECLARE_HANDLE(HPEN);
291 DECLARE_HANDLE(HRGN);
292 DECLARE_HANDLE(HRSRC);
293 DECLARE_HANDLE(HSTR);
294 DECLARE_HANDLE(HTASK);
295 DECLARE_HANDLE(HWND);
296 DECLARE_HANDLE(HWINSTA);
299 typedef HICON HCURSOR;
300 typedef DWORD COLORREF;
301 typedef int (WINAPI *FARPROC)();
302 typedef int (WINAPI *NEARPROC)();
303 typedef int (WINAPI *PROC)();
304 typedef struct tagRECT {
309 } RECT,*PRECT,*LPRECT;
310 typedef const RECT *LPCRECT;
311 typedef struct tagRECTL {
316 } RECTL,*PRECTL,*LPRECTL;
317 typedef const RECTL *LPCRECTL;
318 typedef struct tagPOINT {
321 } POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
322 typedef struct tagSIZE {
325 } SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
326 typedef struct tagPOINTS {
329 } POINTS,*PPOINTS,*LPPOINTS;