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)
78 /* needed by header files generated by WIDL */
80 #define WINE_NO_UNICODE_MACROS
83 #ifdef WINE_NO_UNICODE_MACROS
84 # define WINELIB_NAME_AW(func) \
85 func##_must_be_suffixed_with_W_or_A_in_this_context \
86 func##_must_be_suffixed_with_W_or_A_in_this_context
87 #else /* WINE_NO_UNICODE_MACROS */
89 # define WINELIB_NAME_AW(func) func##W
91 # define WINELIB_NAME_AW(func) func##A
93 #endif /* WINE_NO_UNICODE_MACROS */
95 #ifdef WINE_NO_UNICODE_MACROS
96 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
98 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
102 #define PACKED __attribute__((packed))
104 #define _fastcall __attribute__((fastcall))
107 #define __fastcall __attribute__((fastcall))
110 #define _stdcall __attribute__((stdcall))
113 #define __stdcall __attribute__((stdcall))
116 #define _cdecl __attribute__((cdecl))
119 #define __cdecl __attribute__((cdecl))
122 #define __declspec(e) __attribute__((e))
125 #define _declspec(e) __attribute__((e))
127 #elif defined(__WATCOMC__)
138 #define pascal __stdcall
139 #define _pascal __stdcall
140 #define __pascal __stdcall
144 #if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
145 #define CALLBACK __stdcall
146 #define WINAPI __stdcall
147 #define WINAPIV __cdecl
148 #define APIENTRY WINAPI
149 #define APIPRIVATE __stdcall
150 #define PASCAL __stdcall
155 #define APIENTRY WINAPI
157 #define PASCAL pascal
160 #define DECLSPEC_IMPORT __declspec(dllimport)
161 #define DECLSPEC_EXPORT __declspec(dllexport)
162 #ifndef DECLSPEC_NOINLINE
163 #if (_MSC_VER >= 1300)
164 #define DECLSPEC_NOINLINE __declspec(noinline)
165 #elif defined(__GNUC__)
166 #define DECLSPEC_NOINLINE __attribute__((noinline))
168 #define DECLSPEC_NOINLINE
172 #define DECLSPEC_NORETURN __declspec(noreturn)
173 #define DECLARE_STDCALL_P( type ) __stdcall type
174 #elif defined(__WATCOMC__)
175 #define DECLSPEC_NORETURN
176 #define DECLARE_STDCALL_P( type ) type __stdcall
177 #elif defined(_MSC_VER)
178 #define DECLSPEC_NORETURN __declspec(noreturn)
179 #define DECLARE_STDCALL_P( type ) type __stdcall
180 #endif /* __GNUC__/__WATCOMC__ */
181 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
182 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
183 #define LOWORD(l) ((WORD)((DWORD_PTR)(l)))
184 #define HIWORD(l) ((WORD)(((DWORD_PTR)(l)>>16)&0xFFFF))
185 #define LOBYTE(w) ((BYTE)(w))
186 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
199 #define max(a,b) ((a)>(b)?(a):(b))
203 #define min(a,b) ((a)<(b)?(a):(b))
207 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
208 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
209 #define DBG_UNREFERENCED_PARAMETER(P)
210 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
212 #ifndef __ANONYMOUS_DEFINED
213 #define __ANONYMOUS_DEFINED
215 #ifndef NONAMELESSUNION
217 #define _ANONYMOUS_UNION __extension__
218 #define _ANONYMOUS_STRUCT __extension__
219 #elif defined(__WATCOMC__) || defined(_MSC_VER)
220 #define _ANONYMOUS_UNION
221 #define _ANONYMOUS_STRUCT
222 #endif /* __GNUC__/__WATCOMC__ */
223 #endif /* NONAMELESSUNION */
225 #ifndef _ANONYMOUS_UNION
226 #define _ANONYMOUS_UNION
227 #define _UNION_NAME(x) x
228 #define DUMMYUNIONNAME u
229 #define DUMMYUNIONNAME1 u1
230 #define DUMMYUNIONNAME2 u2
231 #define DUMMYUNIONNAME3 u3
232 #define DUMMYUNIONNAME4 u4
233 #define DUMMYUNIONNAME5 u5
234 #define DUMMYUNIONNAME6 u6
235 #define DUMMYUNIONNAME7 u7
236 #define DUMMYUNIONNAME8 u8
238 #define _UNION_NAME(x)
239 #define DUMMYUNIONNAME
240 #define DUMMYUNIONNAME1
241 #define DUMMYUNIONNAME2
242 #define DUMMYUNIONNAME3
243 #define DUMMYUNIONNAME4
244 #define DUMMYUNIONNAME5
245 #define DUMMYUNIONNAME6
246 #define DUMMYUNIONNAME7
247 #define DUMMYUNIONNAME8
249 #ifndef _ANONYMOUS_STRUCT
250 #define _ANONYMOUS_STRUCT
251 #define _STRUCT_NAME(x) x
252 #define DUMMYSTRUCTNAME s
253 #define DUMMYSTRUCTNAME1 s1
254 #define DUMMYSTRUCTNAME2 s2
255 #define DUMMYSTRUCTNAME3 s3
256 #define DUMMYSTRUCTNAME4 s4
257 #define DUMMYSTRUCTNAME5 s5
259 #define _STRUCT_NAME(x)
260 #define DUMMYSTRUCTNAME
261 #define DUMMYSTRUCTNAME1
262 #define DUMMYSTRUCTNAME2
263 #define DUMMYSTRUCTNAME3
264 #define DUMMYSTRUCTNAME4
265 #define DUMMYSTRUCTNAME5
268 #endif /* __ANONYMOUS_DEFINED */
276 #ifndef DWORD_DEFINED
277 #define DWORD_DEFINED
278 #ifndef __ROS_LONG64__
279 typedef unsigned long DWORD
;
281 typedef unsigned int DWORD
;
283 #endif//DWORD_DEFINED
285 typedef int WINBOOL
,*PWINBOOL
,*LPWINBOOL
;
286 /* FIXME: Is there a good solution to this? */
287 #ifndef XFree86Server
289 typedef WINBOOL BOOL
;
293 typedef unsigned char BYTE
;
294 #endif /* ndef XFree86Server */
295 typedef BOOL
*PBOOL
,*LPBOOL
;
296 typedef unsigned short WORD
;
298 typedef FLOAT
*PFLOAT
;
299 typedef BYTE
*PBYTE
,*LPBYTE
;
300 typedef int *PINT
,*LPINT
;
301 typedef WORD
*PWORD
,*LPWORD
;
302 #ifndef __ROS_LONG64__
303 typedef long *LPLONG
;
307 typedef DWORD
*PDWORD
,*LPDWORD
;
308 typedef CONST
void *LPCVOID
;
310 typedef unsigned int UINT
,*PUINT
,*LPUINT
;
312 typedef void *LPVOID
;
315 # if defined(__x86_64__) && defined (__GNUC__)
316 # define __ms_va_list __builtin_ms_va_list
317 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
318 # define __ms_va_end(list) __builtin_ms_va_end(list)
320 # define __ms_va_list va_list
321 # define __ms_va_start(list,arg) va_start(list,arg)
322 # define __ms_va_end(list) va_end(list)
327 // Check if ntdef.h already defined these for us
331 #ifndef __ROS_LONG64__
332 typedef unsigned long ULONG
, *PULONG
;
334 typedef unsigned int ULONG
, *PULONG
;
336 typedef unsigned short USHORT
, *PUSHORT
;
337 typedef unsigned char UCHAR
, *PUCHAR
;
340 #endif /* BASETYPES */
346 typedef HANDLE
*LPHANDLE
;
347 typedef UINT_PTR WPARAM
;
348 typedef LONG_PTR LPARAM
;
349 typedef LONG_PTR LRESULT
;
350 #ifndef _HRESULT_DEFINED
351 typedef LONG HRESULT
;
352 #define _HRESULT_DEFINED
354 #ifndef XFree86Server
356 #endif /* XFree86Server */
357 typedef HANDLE HGLOBAL
;
358 typedef HANDLE HLOCAL
;
359 typedef HANDLE GLOBALHANDLE
;
360 typedef HANDLE LOCALHANDLE
;
361 typedef void *HGDIOBJ
;
362 DECLARE_HANDLE(HACCEL
);
363 DECLARE_HANDLE(HBITMAP
);
364 DECLARE_HANDLE(HBRUSH
);
365 DECLARE_HANDLE(HCOLORSPACE
);
367 DECLARE_HANDLE(HGLRC
);
368 DECLARE_HANDLE(HDESK
);
369 DECLARE_HANDLE(HENHMETAFILE
);
370 DECLARE_HANDLE(HFONT
);
371 DECLARE_HANDLE(HICON
);
372 DECLARE_HANDLE(HKEY
);
373 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
374 /* #if (WINVER >= 0x0500) */
375 DECLARE_HANDLE(HMONITOR
);
376 DECLARE_HANDLE(HUMPD
);
377 #define HMONITOR_DECLARED 1
378 DECLARE_HANDLE(HTERMINAL
);
379 DECLARE_HANDLE(HWINEVENTHOOK
);
382 DECLARE_HANDLE(HMENU
);
383 DECLARE_HANDLE(HMETAFILE
);
384 DECLARE_HANDLE(HINSTANCE
);
385 typedef HINSTANCE HMODULE
;
386 DECLARE_HANDLE(HPALETTE
);
387 DECLARE_HANDLE(HPEN
);
388 DECLARE_HANDLE(HRGN
);
389 DECLARE_HANDLE(HRSRC
);
390 DECLARE_HANDLE(HSTR
);
391 DECLARE_HANDLE(HTASK
);
392 DECLARE_HANDLE(HWND
);
393 DECLARE_HANDLE(HWINSTA
);
396 typedef HICON HCURSOR
;
397 typedef DWORD COLORREF
;
399 typedef INT_PTR (FAR WINAPI
*FARPROC
)();
400 typedef INT_PTR (NEAR WINAPI
*NEARPROC
)();
401 typedef INT_PTR (WINAPI
*PROC
)();
403 typedef int (FAR WINAPI
*FARPROC
)();
404 typedef int (NEAR WINAPI
*NEARPROC
)();
405 typedef int (WINAPI
*PROC
)();
407 typedef struct tagRECT
{
412 } RECT
,*PRECT
,*LPRECT
;
413 typedef const RECT
*LPCRECT
;
414 typedef struct tagRECTL
{
419 } RECTL
,*PRECTL
,*LPRECTL
;
420 typedef const RECTL
*LPCRECTL
;
421 typedef struct tagPOINT
{
424 } POINT
,POINTL
,*PPOINT
,*LPPOINT
,*PPOINTL
,*LPPOINTL
;
425 typedef struct tagSIZE
{
428 } SIZE
,SIZEL
,*PSIZE
,*LPSIZE
,*PSIZEL
,*LPSIZEL
;
429 typedef struct tagPOINTS
{
432 } POINTS
,*PPOINTS
,*LPPOINTS
;