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
71 #define PACKED __attribute__((packed))
73 #define _fastcall __attribute__((fastcall))
76 #define __fastcall __attribute__((fastcall))
79 #define _stdcall __attribute__((stdcall))
82 #define __stdcall __attribute__((stdcall))
85 #define _cdecl __attribute__((cdecl))
88 #define __cdecl __attribute__((cdecl))
91 #define __declspec(e) __attribute__((e))
94 #define _declspec(e) __attribute__((e))
96 #elif defined(__WATCOMC__)
107 #define pascal __stdcall
108 #define _pascal __stdcall
109 #define __pascal __stdcall
110 #define PASCAL _pascal
112 #define STDCALL __stdcall
113 #define FASTCALL __fastcall
114 #define WINAPI __stdcall
115 #define WINAPIV __cdecl
116 #define APIENTRY __stdcall
117 #define CALLBACK __stdcall
118 #define APIPRIVATE __stdcall
120 #define DECLSPEC_IMPORT __declspec(dllimport)
121 #define DECLSPEC_EXPORT __declspec(dllexport)
123 #define DECLSPEC_NORETURN __declspec(noreturn)
124 #define DECLARE_STDCALL_P( type ) __stdcall type
125 #elif defined(__WATCOMC__)
126 #define DECLSPEC_NORETURN
127 #define DECLARE_STDCALL_P( type ) type __stdcall
128 #endif /* __GNUC__/__WATCOMC__ */
129 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
130 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
131 #define LOWORD(l) ((WORD)((DWORD)(l)))
132 #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
133 #define LOBYTE(w) ((BYTE)(w))
134 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
147 #define max(a,b) ((a)>(b)?(a):(b))
150 #define min(a,b) ((a)<(b)?(a):(b))
154 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
155 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
156 #define DBG_UNREFERENCED_PARAMETER(P)
157 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
159 #ifndef NONAMELESSUNION
161 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
162 #define _ANONYMOUS_UNION __extension__
163 #define _ANONYMOUS_STRUCT __extension__
165 #if defined(__cplusplus)
166 #define _ANONYMOUS_UNION __extension__
167 #endif /* __cplusplus */
168 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
169 #elif defined(__WATCOMC__)
170 #define _ANONYMOUS_UNION
171 #define _ANONYMOUS_STRUCT
172 #endif /* __GNUC__/__WATCOMC__ */
173 #endif /* NONAMELESSUNION */
175 #ifndef _ANONYMOUS_UNION
176 #define _ANONYMOUS_UNION
177 #define _UNION_NAME(x) x
178 #define DUMMYUNIONNAME u
179 #define DUMMYUNIONNAME2 u2
180 #define DUMMYUNIONNAME3 u3
181 #define DUMMYUNIONNAME4 u4
182 #define DUMMYUNIONNAME5 u5
183 #define DUMMYUNIONNAME6 u6
184 #define DUMMYUNIONNAME7 u7
185 #define DUMMYUNIONNAME8 u8
187 #define _UNION_NAME(x)
188 #define DUMMYUNIONNAME
189 #define DUMMYUNIONNAME2
190 #define DUMMYUNIONNAME3
191 #define DUMMYUNIONNAME4
192 #define DUMMYUNIONNAME5
193 #define DUMMYUNIONNAME6
194 #define DUMMYUNIONNAME7
195 #define DUMMYUNIONNAME8
197 #ifndef _ANONYMOUS_STRUCT
198 #define _ANONYMOUS_STRUCT
199 #define _STRUCT_NAME(x) x
200 #define DUMMYSTRUCTNAME s
201 #define DUMMYSTRUCTNAME2 s2
202 #define DUMMYSTRUCTNAME3 s3
204 #define _STRUCT_NAME(x)
205 #define DUMMYSTRUCTNAME
206 #define DUMMYSTRUCTNAME2
207 #define DUMMYSTRUCTNAME3
216 /* FIXME: This will make some code compile. The programs will most
217 likely crash when an exception is raised, but at least they will
219 #if defined (__GNUC__) && defined (__SEH_NOOP)
221 #define __except(x) if (0) /* don't execute handler */
225 #define _except __except
226 #define _finally __finally
229 typedef unsigned long DWORD
;
230 typedef int WINBOOL
,*PWINBOOL
,*LPWINBOOL
;
231 /* FIXME: Is there a good solution to this? */
232 #ifndef XFree86Server
234 typedef WINBOOL BOOL
;
238 typedef unsigned char BYTE
;
239 #endif /* ndef XFree86Server */
240 typedef BOOL
*PBOOL
,*LPBOOL
;
241 typedef unsigned short WORD
;
243 typedef FLOAT
*PFLOAT
;
244 typedef BYTE
*PBYTE
,*LPBYTE
;
245 typedef int *PINT
,*LPINT
;
246 typedef WORD
*PWORD
,*LPWORD
;
247 typedef long *LPLONG
;
248 typedef DWORD
*PDWORD
,*LPDWORD
;
249 typedef CONST
void *PCVOID
,*LPCVOID
;
251 typedef unsigned int UINT
,*PUINT
,*LPUINT
;
255 typedef UINT_PTR WPARAM
;
256 typedef LONG_PTR LPARAM
;
257 typedef LONG_PTR LRESULT
;
258 #ifndef _HRESULT_DEFINED
259 typedef LONG HRESULT
;
260 #define _HRESULT_DEFINED
262 #ifndef XFree86Server
264 #endif /* XFree86Server */
265 typedef HANDLE HGLOBAL
;
266 typedef HANDLE HLOCAL
;
267 typedef HANDLE GLOBALHANDLE
;
268 typedef HANDLE LOCALHANDLE
;
269 typedef void *HGDIOBJ
;
270 DECLARE_HANDLE(HACCEL
);
271 DECLARE_HANDLE(HBITMAP
);
272 DECLARE_HANDLE(HBRUSH
);
273 DECLARE_HANDLE(HCOLORSPACE
);
275 DECLARE_HANDLE(HGLRC
);
276 DECLARE_HANDLE(HDESK
);
277 DECLARE_HANDLE(HENHMETAFILE
);
278 DECLARE_HANDLE(HFONT
);
279 DECLARE_HANDLE(HICON
);
280 DECLARE_HANDLE(HKEY
);
281 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
282 DECLARE_HANDLE(HMONITOR
);
283 #define HMONITOR_DECLARED 1
284 DECLARE_HANDLE(HTERMINAL
);
285 DECLARE_HANDLE(HWINEVENTHOOK
);
288 DECLARE_HANDLE(HMENU
);
289 DECLARE_HANDLE(HMETAFILE
);
290 DECLARE_HANDLE(HINSTANCE
);
291 typedef HINSTANCE HMODULE
;
292 DECLARE_HANDLE(HPALETTE
);
293 DECLARE_HANDLE(HPEN
);
294 DECLARE_HANDLE(HRGN
);
295 DECLARE_HANDLE(HRSRC
);
296 DECLARE_HANDLE(HSTR
);
297 DECLARE_HANDLE(HTASK
);
298 DECLARE_HANDLE(HWND
);
299 DECLARE_HANDLE(HWINSTA
);
302 typedef HICON HCURSOR
;
303 typedef DWORD COLORREF
;
304 typedef int (WINAPI
*FARPROC
)();
305 typedef int (WINAPI
*NEARPROC
)();
306 typedef int (WINAPI
*PROC
)();
307 typedef struct tagRECT
{
312 } RECT
,*PRECT
,*LPRECT
;
313 typedef const RECT
*LPCRECT
;
314 typedef struct tagRECTL
{
319 } RECTL
,*PRECTL
,*LPRECTL
;
320 typedef const RECTL
*LPCRECTL
;
321 typedef struct tagPOINT
{
324 } POINT
,POINTL
,*PPOINT
,*LPPOINT
,*PPOINTL
,*LPPOINTL
;
325 typedef struct tagSIZE
{
328 } SIZE
,SIZEL
,*PSIZE
,*LPSIZE
,*PSIZEL
,*LPSIZEL
;
329 typedef struct tagPOINTS
{
332 } POINTS
,*PPOINTS
,*LPPOINTS
;