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 FASTCALL __fastcall
107 #define WINAPI __stdcall
108 #define WINAPIV __cdecl
109 #define APIENTRY __stdcall
110 #define CALLBACK __stdcall
111 #define APIPRIVATE __stdcall
113 #define DECLSPEC_IMPORT __declspec(dllimport)
114 #define DECLSPEC_EXPORT __declspec(dllexport)
116 #define DECLSPEC_NORETURN __declspec(noreturn)
117 #define DECLARE_STDCALL_P( type ) __stdcall type
118 #elif defined(__WATCOMC__)
119 #define DECLSPEC_NORETURN
120 #define DECLARE_STDCALL_P( type ) type __stdcall
121 #endif /* __GNUC__/__WATCOMC__ */
122 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
123 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
124 #define LOWORD(l) ((WORD)((DWORD)(l)))
125 #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
126 #define LOBYTE(w) ((BYTE)(w))
127 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
140 #define max(a,b) ((a)>(b)?(a):(b))
143 #define min(a,b) ((a)<(b)?(a):(b))
147 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
148 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
149 #define DBG_UNREFERENCED_PARAMETER(P)
150 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
153 #ifndef NONAMELESSUNION
154 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
155 #define _ANONYMOUS_UNION __extension__
156 #define _ANONYMOUS_STRUCT __extension__
158 #if defined(__cplusplus)
159 #define _ANONYMOUS_UNION __extension__
160 #endif /* __cplusplus */
161 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
162 #endif /* NONAMELESSUNION */
163 #elif defined(__WATCOMC__)
164 #define _ANONYMOUS_UNION
165 #define _ANONYMOUS_STRUCT
166 #endif /* __GNUC__/__WATCOMC__ */
168 #ifndef _ANONYMOUS_UNION
169 #define _ANONYMOUS_UNION
170 #define _UNION_NAME(x) x
171 #define DUMMYUNIONNAME u
172 #define DUMMYUNIONNAME2 u2
173 #define DUMMYUNIONNAME3 u3
174 #define DUMMYUNIONNAME4 u4
175 #define DUMMYUNIONNAME5 u5
176 #define DUMMYUNIONNAME6 u6
177 #define DUMMYUNIONNAME7 u7
178 #define DUMMYUNIONNAME8 u8
180 #define _UNION_NAME(x)
181 #define DUMMYUNIONNAME
182 #define DUMMYUNIONNAME2
183 #define DUMMYUNIONNAME3
184 #define DUMMYUNIONNAME4
185 #define DUMMYUNIONNAME5
186 #define DUMMYUNIONNAME6
187 #define DUMMYUNIONNAME7
188 #define DUMMYUNIONNAME8
190 #ifndef _ANONYMOUS_STRUCT
191 #define _ANONYMOUS_STRUCT
192 #define _STRUCT_NAME(x) x
193 #define DUMMYSTRUCTNAME s
194 #define DUMMYSTRUCTNAME2 s2
195 #define DUMMYSTRUCTNAME3 s3
197 #define _STRUCT_NAME(x)
198 #define DUMMYSTRUCTNAME
199 #define DUMMYSTRUCTNAME2
200 #define DUMMYSTRUCTNAME3
209 /* FIXME: This will make some code compile. The programs will most
210 likely crash when an exception is raised, but at least they will
212 #if defined (__GNUC__) && defined (__SEH_NOOP)
214 #define __except(x) if (0) /* don't execute handler */
218 #define _except __except
219 #define _finally __finally
222 typedef unsigned long DWORD
;
223 typedef int WINBOOL
,*PWINBOOL
,*LPWINBOOL
;
224 /* FIXME: Is there a good solution to this? */
225 #ifndef XFree86Server
227 typedef WINBOOL BOOL
;
231 typedef unsigned char BYTE
;
232 #endif /* ndef XFree86Server */
233 typedef BOOL
*PBOOL
,*LPBOOL
;
234 typedef unsigned short WORD
;
236 typedef FLOAT
*PFLOAT
;
237 typedef BYTE
*PBYTE
,*LPBYTE
;
238 typedef int *PINT
,*LPINT
;
239 typedef WORD
*PWORD
,*LPWORD
;
240 typedef long *LPLONG
;
241 typedef DWORD
*PDWORD
,*LPDWORD
;
242 typedef CONST
void *PCVOID
,*LPCVOID
;
244 typedef unsigned int UINT
,*PUINT
,*LPUINT
;
248 typedef UINT_PTR WPARAM
;
249 typedef LONG_PTR LPARAM
;
250 typedef LONG_PTR LRESULT
;
251 #ifndef _HRESULT_DEFINED
252 typedef LONG HRESULT
;
253 #define _HRESULT_DEFINED
255 #ifndef XFree86Server
257 #endif /* XFree86Server */
258 typedef HANDLE HGLOBAL
;
259 typedef HANDLE HLOCAL
;
260 typedef HANDLE GLOBALHANDLE
;
261 typedef HANDLE LOCALHANDLE
;
262 typedef void *HGDIOBJ
;
263 DECLARE_HANDLE(HACCEL
);
264 DECLARE_HANDLE(HBITMAP
);
265 DECLARE_HANDLE(HBRUSH
);
266 DECLARE_HANDLE(HCOLORSPACE
);
268 DECLARE_HANDLE(HGLRC
);
269 DECLARE_HANDLE(HDESK
);
270 DECLARE_HANDLE(HENHMETAFILE
);
271 DECLARE_HANDLE(HFONT
);
272 DECLARE_HANDLE(HICON
);
273 DECLARE_HANDLE(HKEY
);
274 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
275 /* #if (WINVER >= 0x0500) */
276 DECLARE_HANDLE(HMONITOR
);
277 #define HMONITOR_DECLARED 1
278 DECLARE_HANDLE(HTERMINAL
);
279 DECLARE_HANDLE(HWINEVENTHOOK
);
282 DECLARE_HANDLE(HMENU
);
283 DECLARE_HANDLE(HMETAFILE
);
284 DECLARE_HANDLE(HINSTANCE
);
285 typedef HINSTANCE HMODULE
;
286 DECLARE_HANDLE(HPALETTE
);
287 DECLARE_HANDLE(HPEN
);
288 DECLARE_HANDLE(HRGN
);
289 DECLARE_HANDLE(HRSRC
);
290 DECLARE_HANDLE(HSTR
);
291 DECLARE_HANDLE(HTASK
);
292 DECLARE_HANDLE(HWND
);
293 DECLARE_HANDLE(HWINSTA
);
296 typedef HICON HCURSOR
;
297 typedef DWORD COLORREF
;
298 typedef int (WINAPI
*FARPROC
)();
299 typedef int (WINAPI
*NEARPROC
)();
300 typedef int (WINAPI
*PROC
)();
301 typedef struct tagRECT
{
306 } RECT
,*PRECT
,*LPRECT
;
307 typedef const RECT
*LPCRECT
;
308 typedef struct tagRECTL
{
313 } RECTL
,*PRECTL
,*LPRECTL
;
314 typedef const RECTL
*LPCRECTL
;
315 typedef struct tagPOINT
{
318 } POINT
,POINTL
,*PPOINT
,*LPPOINT
,*PPOINTL
,*LPPOINTL
;
319 typedef struct tagSIZE
{
322 } SIZE
,SIZEL
,*PSIZE
,*LPSIZE
,*PSIZEL
,*LPSIZEL
;
323 typedef struct tagPOINTS
{
326 } POINTS
,*PPOINTS
,*LPPOINTS
;