5 #if !defined(__ROS_LONG64__)
18 #pragma warning(disable:4255)
24 * If you need Win32 API features newer the Win95 and WinNT then you must
25 * define WINVER before including windows.h or any other method of including
26 * the windef.h header.
30 #define _WIN32_WINNT WINVER
32 * There may be the need to define _WIN32_WINNT to a value different from
33 * the value of WINVER. I don't have any example of why you would do that.
34 * However, if you must then define _WIN32_WINNT to the value required before
35 * including windows.h or any other method of including the windef.h header.
58 #define NULL ((void*)0)
73 /* needed by header files generated by WIDL */
75 #define WINE_NO_UNICODE_MACROS
78 #ifdef WINE_NO_UNICODE_MACROS
79 # define WINELIB_NAME_AW(func) \
80 func##_must_be_suffixed_with_W_or_A_in_this_context \
81 func##_must_be_suffixed_with_W_or_A_in_this_context
82 #else /* WINE_NO_UNICODE_MACROS */
84 # define WINELIB_NAME_AW(func) func##W
86 # define WINELIB_NAME_AW(func) func##A
88 #endif /* WINE_NO_UNICODE_MACROS */
90 #ifdef WINE_NO_UNICODE_MACROS
91 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
93 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
97 #define PACKED __attribute__((packed))
99 #define _fastcall __attribute__((fastcall))
102 #define __fastcall __attribute__((fastcall))
105 #define _stdcall __attribute__((stdcall))
108 #define __stdcall __attribute__((stdcall))
111 #define _cdecl __attribute__((cdecl))
114 #define __cdecl __attribute__((cdecl))
117 #define __declspec(e) __attribute__((e))
120 #define _declspec(e) __attribute__((e))
122 #elif defined(__WATCOMC__)
133 #define pascal __stdcall
134 #define _pascal __stdcall
135 #define __pascal __stdcall
139 #if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
140 #define CALLBACK __stdcall
141 #define WINAPI __stdcall
142 #define WINAPIV __cdecl
143 #define APIENTRY WINAPI
144 #define APIPRIVATE __stdcall
145 #define PASCAL __stdcall
150 #define APIENTRY WINAPI
152 #define PASCAL pascal
155 #define DECLSPEC_IMPORT __declspec(dllimport)
156 #define DECLSPEC_EXPORT __declspec(dllexport)
157 #ifndef DECLSPEC_NOINLINE
158 #if (_MSC_VER >= 1300)
159 #define DECLSPEC_NOINLINE __declspec(noinline)
160 #elif defined(__GNUC__)
161 #define DECLSPEC_NOINLINE __attribute__((noinline))
163 #define DECLSPEC_NOINLINE
167 #define DECLSPEC_NORETURN __declspec(noreturn)
168 #define DECLARE_STDCALL_P( type ) __stdcall type
169 #elif defined(__WATCOMC__)
170 #define DECLSPEC_NORETURN
171 #define DECLARE_STDCALL_P( type ) type __stdcall
172 #elif defined(_MSC_VER)
173 #define DECLSPEC_NORETURN __declspec(noreturn)
174 #define DECLARE_STDCALL_P( type ) type __stdcall
175 #endif /* __GNUC__/__WATCOMC__ */
176 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
177 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
178 #define LOWORD(l) ((WORD)((DWORD_PTR)(l)))
179 #define HIWORD(l) ((WORD)(((DWORD_PTR)(l)>>16)&0xFFFF))
180 #define LOBYTE(w) ((BYTE)(w))
181 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
194 #define max(a,b) ((a)>(b)?(a):(b))
198 #define min(a,b) ((a)<(b)?(a):(b))
202 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
203 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
204 #define DBG_UNREFERENCED_PARAMETER(P)
205 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
207 #ifndef NONAMELESSUNION
209 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
210 #define _ANONYMOUS_UNION __extension__
211 #define _ANONYMOUS_STRUCT __extension__
213 #if defined(__cplusplus)
214 #define _ANONYMOUS_UNION __extension__
215 #endif /* __cplusplus */
216 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
217 #elif defined(__WATCOMC__) || defined(_MSC_VER)
218 #define _ANONYMOUS_UNION
219 #define _ANONYMOUS_STRUCT
220 #endif /* __GNUC__/__WATCOMC__ */
221 #endif /* NONAMELESSUNION */
223 #ifndef _ANONYMOUS_UNION
224 #define _ANONYMOUS_UNION
225 #define _UNION_NAME(x) x
226 #define DUMMYUNIONNAME u
227 #define DUMMYUNIONNAME1 u1
228 #define DUMMYUNIONNAME2 u2
229 #define DUMMYUNIONNAME3 u3
230 #define DUMMYUNIONNAME4 u4
231 #define DUMMYUNIONNAME5 u5
232 #define DUMMYUNIONNAME6 u6
233 #define DUMMYUNIONNAME7 u7
234 #define DUMMYUNIONNAME8 u8
236 #define _UNION_NAME(x)
237 #define DUMMYUNIONNAME
238 #define DUMMYUNIONNAME1
239 #define DUMMYUNIONNAME2
240 #define DUMMYUNIONNAME3
241 #define DUMMYUNIONNAME4
242 #define DUMMYUNIONNAME5
243 #define DUMMYUNIONNAME6
244 #define DUMMYUNIONNAME7
245 #define DUMMYUNIONNAME8
247 #ifndef _ANONYMOUS_STRUCT
248 #define _ANONYMOUS_STRUCT
249 #define _STRUCT_NAME(x) x
250 #define DUMMYSTRUCTNAME s
251 #define DUMMYSTRUCTNAME1 s1
252 #define DUMMYSTRUCTNAME2 s2
253 #define DUMMYSTRUCTNAME3 s3
254 #define DUMMYSTRUCTNAME4 s4
255 #define DUMMYSTRUCTNAME5 s5
257 #define _STRUCT_NAME(x)
258 #define DUMMYSTRUCTNAME
259 #define DUMMYSTRUCTNAME1
260 #define DUMMYSTRUCTNAME2
261 #define DUMMYSTRUCTNAME3
262 #define DUMMYSTRUCTNAME4
263 #define DUMMYSTRUCTNAME5
272 #ifndef DWORD_DEFINED
273 #define DWORD_DEFINED
274 #ifndef __ROS_LONG64__
275 typedef unsigned long DWORD
;
277 typedef unsigned int DWORD
;
279 #endif//DWORD_DEFINED
281 typedef int WINBOOL
,*PWINBOOL
,*LPWINBOOL
;
282 /* FIXME: Is there a good solution to this? */
283 #ifndef XFree86Server
285 typedef WINBOOL BOOL
;
289 typedef unsigned char BYTE
;
290 #endif /* ndef XFree86Server */
291 typedef BOOL
*PBOOL
,*LPBOOL
;
292 typedef unsigned short WORD
;
294 typedef FLOAT
*PFLOAT
;
295 typedef BYTE
*PBYTE
,*LPBYTE
;
296 typedef int *PINT
,*LPINT
;
297 typedef WORD
*PWORD
,*LPWORD
;
298 #ifndef __ROS_LONG64__
299 typedef long *LPLONG
;
303 typedef DWORD
*PDWORD
,*LPDWORD
;
304 typedef CONST
void *PCVOID
,*LPCVOID
;
306 typedef unsigned int UINT
,*PUINT
,*LPUINT
;
308 typedef void *LPVOID
;
311 # if defined(__x86_64__) && defined (__GNUC__)
312 # define __ms_va_list __builtin_ms_va_list
313 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
314 # define __ms_va_end(list) __builtin_ms_va_end(list)
316 # define __ms_va_list va_list
317 # define __ms_va_start(list,arg) va_start(list,arg)
318 # define __ms_va_end(list) va_end(list)
323 // Check if ntdef.h already defined these for us
327 #ifndef __ROS_LONG64__
328 typedef unsigned long ULONG
, *PULONG
;
330 typedef unsigned int ULONG
, *PULONG
;
332 typedef unsigned short USHORT
, *PUSHORT
;
333 typedef unsigned char UCHAR
, *PUCHAR
;
336 #endif /* BASETYPES */
342 typedef HANDLE
*LPHANDLE
;
343 typedef UINT_PTR WPARAM
;
344 typedef LONG_PTR LPARAM
;
345 typedef LONG_PTR LRESULT
;
346 #ifndef _HRESULT_DEFINED
347 typedef LONG HRESULT
;
348 #define _HRESULT_DEFINED
350 #ifndef XFree86Server
352 #endif /* XFree86Server */
353 typedef HANDLE HGLOBAL
;
354 typedef HANDLE HLOCAL
;
355 typedef HANDLE GLOBALHANDLE
;
356 typedef HANDLE LOCALHANDLE
;
357 typedef void *HGDIOBJ
;
358 DECLARE_HANDLE(HACCEL
);
359 DECLARE_HANDLE(HBITMAP
);
360 DECLARE_HANDLE(HBRUSH
);
361 DECLARE_HANDLE(HCOLORSPACE
);
363 DECLARE_HANDLE(HGLRC
);
364 DECLARE_HANDLE(HDESK
);
365 DECLARE_HANDLE(HENHMETAFILE
);
366 DECLARE_HANDLE(HFONT
);
367 DECLARE_HANDLE(HICON
);
368 DECLARE_HANDLE(HKEY
);
369 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
370 /* #if (WINVER >= 0x0500) */
371 DECLARE_HANDLE(HMONITOR
);
372 DECLARE_HANDLE(HUMPD
);
373 #define HMONITOR_DECLARED 1
374 DECLARE_HANDLE(HTERMINAL
);
375 DECLARE_HANDLE(HWINEVENTHOOK
);
378 DECLARE_HANDLE(HMENU
);
379 DECLARE_HANDLE(HMETAFILE
);
380 DECLARE_HANDLE(HINSTANCE
);
381 typedef HINSTANCE HMODULE
;
382 DECLARE_HANDLE(HPALETTE
);
383 DECLARE_HANDLE(HPEN
);
384 DECLARE_HANDLE(HRGN
);
385 DECLARE_HANDLE(HRSRC
);
386 DECLARE_HANDLE(HSTR
);
387 DECLARE_HANDLE(HTASK
);
388 DECLARE_HANDLE(HWND
);
389 DECLARE_HANDLE(HWINSTA
);
392 typedef HICON HCURSOR
;
393 typedef DWORD COLORREF
;
394 typedef DWORD
* LPCOLORREF
;
396 typedef INT_PTR (FAR WINAPI
*FARPROC
)();
397 typedef INT_PTR (NEAR WINAPI
*NEARPROC
)();
398 typedef INT_PTR (WINAPI
*PROC
)();
400 typedef int (FAR WINAPI
*FARPROC
)();
401 typedef int (NEAR WINAPI
*NEARPROC
)();
402 typedef int (WINAPI
*PROC
)();
404 typedef struct tagRECT
{
409 } RECT
,*PRECT
,*LPRECT
;
410 typedef const RECT
*LPCRECT
;
411 typedef struct tagRECTL
{
416 } RECTL
,*PRECTL
,*LPRECTL
;
417 typedef const RECTL
*LPCRECTL
;
418 typedef struct tagPOINT
{
421 } POINT
,POINTL
,*PPOINT
,*LPPOINT
,*PPOINTL
,*LPPOINTL
;
422 typedef struct tagSIZE
{
425 } SIZE
,SIZEL
,*PSIZE
,*LPSIZE
,*PSIZEL
,*LPSIZEL
;
426 typedef struct tagPOINTS
{
429 } POINTS
,*PPOINTS
,*LPPOINTS
;