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)
64 #define PACKED __attribute__((packed))
66 #define _fastcall __attribute__((fastcall))
69 #define __fastcall __attribute__((fastcall))
72 #define _stdcall __attribute__((stdcall))
75 #define __stdcall __attribute__((stdcall))
78 #define _cdecl __attribute__((cdecl))
81 #define __cdecl __attribute__((cdecl))
84 #define __declspec(e) __attribute__((e))
87 #define _declspec(e) __attribute__((e))
89 #elif defined(__WATCOMC__)
100 #define pascal __stdcall
101 #define _pascal __stdcall
102 #define __pascal __stdcall
103 #define PASCAL _pascal
105 #define STDCALL __stdcall
106 #define WINAPI __stdcall
107 #define WINAPIV __cdecl
108 #define APIENTRY __stdcall
109 #define CALLBACK __stdcall
110 #define APIPRIVATE __stdcall
112 #define DECLSPEC_IMPORT __declspec(dllimport)
113 #define DECLSPEC_EXPORT __declspec(dllexport)
115 #define DECLSPEC_NORETURN __declspec(noreturn)
116 #define DECLARE_STDCALL_P( type ) __stdcall type
117 #elif defined(__WATCOMC__)
118 #define DECLSPEC_NORETURN
119 #define DECLARE_STDCALL_P( type ) type __stdcall
120 #elif defined(_MSC_VER)
121 #define DECLSPEC_NORETURN __declspec(noreturn)
122 #define DECLARE_STDCALL_P( type ) type __stdcall
123 #endif /* __GNUC__/__WATCOMC__ */
124 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
125 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
126 #define LOWORD(l) ((WORD)((DWORD)(l)))
127 #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
128 #define LOBYTE(w) ((BYTE)(w))
129 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
142 #define max(a,b) ((a)>(b)?(a):(b))
145 #define min(a,b) ((a)<(b)?(a):(b))
149 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
150 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
151 #define DBG_UNREFERENCED_PARAMETER(P)
152 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
155 #ifndef NONAMELESSUNION
156 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
157 #define _ANONYMOUS_UNION __extension__
158 #define _ANONYMOUS_STRUCT __extension__
160 #if defined(__cplusplus)
161 #define _ANONYMOUS_UNION __extension__
162 #endif /* __cplusplus */
163 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
164 #endif /* NONAMELESSUNION */
165 #elif defined(__WATCOMC__) || defined(_MSC_VER)
166 #define _ANONYMOUS_UNION
167 #define _ANONYMOUS_STRUCT
168 #endif /* __GNUC__/__WATCOMC__ */
170 #ifndef _ANONYMOUS_UNION
171 #define _ANONYMOUS_UNION
172 #define _UNION_NAME(x) x
173 #define DUMMYUNIONNAME u
174 #define DUMMYUNIONNAME2 u2
175 #define DUMMYUNIONNAME3 u3
176 #define DUMMYUNIONNAME4 u4
177 #define DUMMYUNIONNAME5 u5
178 #define DUMMYUNIONNAME6 u6
179 #define DUMMYUNIONNAME7 u7
180 #define DUMMYUNIONNAME8 u8
182 #define _UNION_NAME(x)
183 #define DUMMYUNIONNAME
184 #define DUMMYUNIONNAME2
185 #define DUMMYUNIONNAME3
186 #define DUMMYUNIONNAME4
187 #define DUMMYUNIONNAME5
188 #define DUMMYUNIONNAME6
189 #define DUMMYUNIONNAME7
190 #define DUMMYUNIONNAME8
192 #ifndef _ANONYMOUS_STRUCT
193 #define _ANONYMOUS_STRUCT
194 #define _STRUCT_NAME(x) x
195 #define DUMMYSTRUCTNAME s
196 #define DUMMYSTRUCTNAME2 s2
197 #define DUMMYSTRUCTNAME3 s3
199 #define _STRUCT_NAME(x)
200 #define DUMMYSTRUCTNAME
201 #define DUMMYSTRUCTNAME2
202 #define DUMMYSTRUCTNAME3
211 /* FIXME: This will make some code compile. The programs will most
212 likely crash when an exception is raised, but at least they will
214 #if defined (__GNUC__) && defined (__SEH_NOOP)
216 #define __except(x) if (0) /* don't execute handler */
220 #define _except __except
221 #define _finally __finally
224 #ifndef DWORD_DEFINED
225 #define DWORD_DEFINED
226 typedef unsigned long DWORD
;
227 #endif//DWORD_DEFINED
229 typedef int WINBOOL
,*PWINBOOL
,*LPWINBOOL
;
230 /* FIXME: Is there a good solution to this? */
231 #ifndef XFree86Server
233 typedef WINBOOL BOOL
;
237 typedef unsigned char BYTE
;
238 #endif /* ndef XFree86Server */
239 typedef BOOL
*PBOOL
,*LPBOOL
;
240 typedef unsigned short WORD
;
242 typedef FLOAT
*PFLOAT
;
243 typedef BYTE
*PBYTE
,*LPBYTE
;
244 typedef int *PINT
,*LPINT
;
245 typedef WORD
*PWORD
,*LPWORD
;
246 typedef long *LPLONG
;
247 typedef DWORD
*PDWORD
,*LPDWORD
;
248 typedef CONST
void *PCVOID
,*LPCVOID
;
250 typedef unsigned int UINT
,*PUINT
,*LPUINT
;
256 typedef UINT_PTR WPARAM
;
257 typedef LONG_PTR LPARAM
;
258 typedef LONG_PTR LRESULT
;
259 #ifndef _HRESULT_DEFINED
260 typedef LONG HRESULT
;
261 #define _HRESULT_DEFINED
263 #ifndef XFree86Server
265 #endif /* XFree86Server */
266 typedef HANDLE HGLOBAL
;
267 typedef HANDLE HLOCAL
;
268 typedef HANDLE GLOBALHANDLE
;
269 typedef HANDLE LOCALHANDLE
;
270 typedef void *HGDIOBJ
;
271 DECLARE_HANDLE(HACCEL
);
272 DECLARE_HANDLE(HBITMAP
);
273 DECLARE_HANDLE(HBRUSH
);
274 DECLARE_HANDLE(HCOLORSPACE
);
276 DECLARE_HANDLE(HGLRC
);
277 DECLARE_HANDLE(HDESK
);
278 DECLARE_HANDLE(HENHMETAFILE
);
279 DECLARE_HANDLE(HFONT
);
280 DECLARE_HANDLE(HICON
);
281 DECLARE_HANDLE(HKEY
);
282 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
283 /* #if (WINVER >= 0x0500) */
284 DECLARE_HANDLE(HMONITOR
);
285 DECLARE_HANDLE(HUMPD
);
286 #define HMONITOR_DECLARED 1
287 DECLARE_HANDLE(HTERMINAL
);
288 DECLARE_HANDLE(HWINEVENTHOOK
);
291 DECLARE_HANDLE(HMENU
);
292 DECLARE_HANDLE(HMETAFILE
);
293 DECLARE_HANDLE(HINSTANCE
);
294 typedef HINSTANCE HMODULE
;
295 DECLARE_HANDLE(HPALETTE
);
296 DECLARE_HANDLE(HPEN
);
297 DECLARE_HANDLE(HRGN
);
298 DECLARE_HANDLE(HRSRC
);
299 DECLARE_HANDLE(HSTR
);
300 DECLARE_HANDLE(HTASK
);
301 DECLARE_HANDLE(HWND
);
302 DECLARE_HANDLE(HWINSTA
);
305 typedef HICON HCURSOR
;
306 typedef DWORD COLORREF
;
307 typedef int (WINAPI
*FARPROC
)();
308 typedef int (WINAPI
*NEARPROC
)();
309 typedef int (WINAPI
*PROC
)();
310 typedef struct tagRECT
{
315 } RECT
,*PRECT
,*LPRECT
;
316 typedef const RECT
*LPCRECT
;
317 typedef struct tagRECTL
{
322 } RECTL
,*PRECTL
,*LPRECTL
;
323 typedef const RECTL
*LPCRECTL
;
324 typedef struct tagPOINT
{
327 } POINT
,POINTL
,*PPOINT
,*LPPOINT
,*PPOINTL
,*LPPOINTL
;
328 typedef struct tagSIZE
{
331 } SIZE
,SIZEL
,*PSIZE
,*LPSIZE
,*PSIZEL
,*LPSIZEL
;
332 typedef struct tagPOINTS
{
335 } POINTS
,*PPOINTS
,*LPPOINTS
;