4 #if !defined(__ROS_LONG64__)
6 //#define __ROS_LONG64__
16 #pragma warning(disable:4255)
22 * If you need Win32 API features newer the Win95 and WinNT then you must
23 * define WINVER before including windows.h or any other method of including
24 * the windef.h header.
28 #define _WIN32_WINNT WINVER
30 * There may be the need to define _WIN32_WINNT to a value different from
31 * the value of WINVER. I don't have any example of why you would do that.
32 * However, if you must then define _WIN32_WINNT to the value required before
33 * including windows.h or any other method of including the windef.h header.
56 #define NULL ((void*)0)
71 /* needed by header files generated by WIDL */
73 #define WINE_NO_UNICODE_MACROS
76 #ifdef WINE_NO_UNICODE_MACROS
77 # define WINELIB_NAME_AW(func) \
78 func##_must_be_suffixed_with_W_or_A_in_this_context \
79 func##_must_be_suffixed_with_W_or_A_in_this_context
80 #else /* WINE_NO_UNICODE_MACROS */
82 # define WINELIB_NAME_AW(func) func##W
84 # define WINELIB_NAME_AW(func) func##A
86 #endif /* WINE_NO_UNICODE_MACROS */
88 #ifdef WINE_NO_UNICODE_MACROS
89 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
91 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
95 #define PACKED __attribute__((packed))
97 #define _fastcall __attribute__((fastcall))
100 #define __fastcall __attribute__((fastcall))
103 #define _stdcall __attribute__((stdcall))
106 #define __stdcall __attribute__((stdcall))
109 #define _cdecl __attribute__((cdecl))
112 #define __cdecl __attribute__((cdecl))
115 #define __declspec(e) __attribute__((e))
118 #define _declspec(e) __attribute__((e))
120 #elif defined(__WATCOMC__)
131 #define pascal __stdcall
132 #define _pascal __stdcall
133 #define __pascal __stdcall
137 #if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
138 #define CALLBACK __stdcall
139 #define WINAPI __stdcall
140 #define WINAPIV __cdecl
141 #define APIENTRY WINAPI
142 #define APIPRIVATE __stdcall
143 #define PASCAL __stdcall
148 #define APIENTRY WINAPI
150 #define PASCAL pascal
153 #define DECLSPEC_IMPORT __declspec(dllimport)
154 #define DECLSPEC_EXPORT __declspec(dllexport)
155 #ifndef DECLSPEC_NOINLINE
156 #if (_MSC_VER >= 1300)
157 #define DECLSPEC_NOINLINE __declspec(noinline)
158 #elif defined(__GNUC__)
159 #define DECLSPEC_NOINLINE __attribute__((noinline))
161 #define DECLSPEC_NOINLINE
165 #define DECLSPEC_NORETURN __declspec(noreturn)
166 #define DECLARE_STDCALL_P( type ) __stdcall type
167 #elif defined(__WATCOMC__)
168 #define DECLSPEC_NORETURN
169 #define DECLARE_STDCALL_P( type ) type __stdcall
170 #elif defined(_MSC_VER)
171 #define DECLSPEC_NORETURN __declspec(noreturn)
172 #define DECLARE_STDCALL_P( type ) type __stdcall
173 #endif /* __GNUC__/__WATCOMC__ */
174 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
175 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
176 #define LOWORD(l) ((WORD)((DWORD_PTR)(l)))
177 #define HIWORD(l) ((WORD)(((DWORD_PTR)(l)>>16)&0xFFFF))
178 #define LOBYTE(w) ((BYTE)(w))
179 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
192 #define max(a,b) ((a)>(b)?(a):(b))
196 #define min(a,b) ((a)<(b)?(a):(b))
200 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
201 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
202 #define DBG_UNREFERENCED_PARAMETER(P)
203 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
206 #ifndef NONAMELESSUNION
207 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
208 #define _ANONYMOUS_UNION __extension__
209 #define _ANONYMOUS_STRUCT __extension__
211 #if defined(__cplusplus)
212 #define _ANONYMOUS_UNION __extension__
213 #endif /* __cplusplus */
214 #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
215 #endif /* NONAMELESSUNION */
216 #elif defined(__WATCOMC__) || defined(_MSC_VER)
217 #define _ANONYMOUS_UNION
218 #define _ANONYMOUS_STRUCT
219 #endif /* __GNUC__/__WATCOMC__ */
221 #ifndef _ANONYMOUS_UNION
222 #define _ANONYMOUS_UNION
223 #define _UNION_NAME(x) x
224 #define DUMMYUNIONNAME u
225 #define DUMMYUNIONNAME1 u1
226 #define DUMMYUNIONNAME2 u2
227 #define DUMMYUNIONNAME3 u3
228 #define DUMMYUNIONNAME4 u4
229 #define DUMMYUNIONNAME5 u5
230 #define DUMMYUNIONNAME6 u6
231 #define DUMMYUNIONNAME7 u7
232 #define DUMMYUNIONNAME8 u8
234 #define _UNION_NAME(x)
235 #define DUMMYUNIONNAME
236 #define DUMMYUNIONNAME1
237 #define DUMMYUNIONNAME2
238 #define DUMMYUNIONNAME3
239 #define DUMMYUNIONNAME4
240 #define DUMMYUNIONNAME5
241 #define DUMMYUNIONNAME6
242 #define DUMMYUNIONNAME7
243 #define DUMMYUNIONNAME8
245 #ifndef _ANONYMOUS_STRUCT
246 #define _ANONYMOUS_STRUCT
247 #define _STRUCT_NAME(x) x
248 #define DUMMYSTRUCTNAME s
249 #define DUMMYSTRUCTNAME1 s1
250 #define DUMMYSTRUCTNAME2 s2
251 #define DUMMYSTRUCTNAME3 s3
252 #define DUMMYSTRUCTNAME4 s4
253 #define DUMMYSTRUCTNAME5 s5
255 #define _STRUCT_NAME(x)
256 #define DUMMYSTRUCTNAME
257 #define DUMMYSTRUCTNAME1
258 #define DUMMYSTRUCTNAME2
259 #define DUMMYSTRUCTNAME3
260 #define DUMMYSTRUCTNAME4
261 #define DUMMYSTRUCTNAME5
270 #ifndef DWORD_DEFINED
271 #define DWORD_DEFINED
272 #ifndef __ROS_LONG64__
273 typedef unsigned long DWORD
;
275 typedef unsigned int DWORD
;
277 #endif//DWORD_DEFINED
279 typedef int WINBOOL
,*PWINBOOL
,*LPWINBOOL
;
280 /* FIXME: Is there a good solution to this? */
281 #ifndef XFree86Server
283 typedef WINBOOL BOOL
;
287 typedef unsigned char BYTE
;
288 #endif /* ndef XFree86Server */
289 typedef BOOL
*PBOOL
,*LPBOOL
;
290 typedef unsigned short WORD
;
292 typedef FLOAT
*PFLOAT
;
293 typedef BYTE
*PBYTE
,*LPBYTE
;
294 typedef int *PINT
,*LPINT
;
295 typedef WORD
*PWORD
,*LPWORD
;
296 #ifndef __ROS_LONG64__
297 typedef long *LPLONG
;
301 typedef DWORD
*PDWORD
,*LPDWORD
;
302 typedef CONST
void *PCVOID
,*LPCVOID
;
304 typedef unsigned int UINT
,*PUINT
,*LPUINT
;
306 typedef void *LPVOID
;
309 # if defined(__x86_64__) && defined (__GNUC__)
310 # define __ms_va_list __builtin_ms_va_list
311 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
312 # define __ms_va_end(list) __builtin_ms_va_end(list)
314 # define __ms_va_list va_list
315 # define __ms_va_start(list,arg) va_start(list,arg)
316 # define __ms_va_end(list) va_end(list)
321 // Check if ntdef.h already defined these for us
325 #ifndef __ROS_LONG64__
326 typedef unsigned long ULONG
, *PULONG
;
328 typedef unsigned int ULONG
, *PULONG
;
330 typedef unsigned short USHORT
, *PUSHORT
;
331 typedef unsigned char UCHAR
, *PUCHAR
;
334 #endif /* BASETYPES */
340 typedef HANDLE
*LPHANDLE
;
341 typedef UINT_PTR WPARAM
;
342 typedef LONG_PTR LPARAM
;
343 typedef LONG_PTR LRESULT
;
344 #ifndef _HRESULT_DEFINED
345 typedef LONG HRESULT
;
346 #define _HRESULT_DEFINED
348 #ifndef XFree86Server
350 #endif /* XFree86Server */
351 typedef HANDLE HGLOBAL
;
352 typedef HANDLE HLOCAL
;
353 typedef HANDLE GLOBALHANDLE
;
354 typedef HANDLE LOCALHANDLE
;
355 typedef void *HGDIOBJ
;
356 DECLARE_HANDLE(HACCEL
);
357 DECLARE_HANDLE(HBITMAP
);
358 DECLARE_HANDLE(HBRUSH
);
359 DECLARE_HANDLE(HCOLORSPACE
);
361 DECLARE_HANDLE(HGLRC
);
362 DECLARE_HANDLE(HDESK
);
363 DECLARE_HANDLE(HENHMETAFILE
);
364 DECLARE_HANDLE(HFONT
);
365 DECLARE_HANDLE(HICON
);
366 DECLARE_HANDLE(HKEY
);
367 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
368 /* #if (WINVER >= 0x0500) */
369 DECLARE_HANDLE(HMONITOR
);
370 DECLARE_HANDLE(HUMPD
);
371 #define HMONITOR_DECLARED 1
372 DECLARE_HANDLE(HTERMINAL
);
373 DECLARE_HANDLE(HWINEVENTHOOK
);
376 DECLARE_HANDLE(HMENU
);
377 DECLARE_HANDLE(HMETAFILE
);
378 DECLARE_HANDLE(HINSTANCE
);
379 typedef HINSTANCE HMODULE
;
380 DECLARE_HANDLE(HPALETTE
);
381 DECLARE_HANDLE(HPEN
);
382 DECLARE_HANDLE(HRGN
);
383 DECLARE_HANDLE(HRSRC
);
384 DECLARE_HANDLE(HSTR
);
385 DECLARE_HANDLE(HTASK
);
386 DECLARE_HANDLE(HWND
);
387 DECLARE_HANDLE(HWINSTA
);
390 typedef HICON HCURSOR
;
391 typedef DWORD COLORREF
;
393 typedef INT_PTR (FAR WINAPI
*FARPROC
)();
394 typedef INT_PTR (NEAR WINAPI
*NEARPROC
)();
395 typedef INT_PTR (WINAPI
*PROC
)();
397 typedef int (FAR WINAPI
*FARPROC
)();
398 typedef int (NEAR WINAPI
*NEARPROC
)();
399 typedef int (WINAPI
*PROC
)();
401 typedef struct tagRECT
{
406 } RECT
,*PRECT
,*LPRECT
;
407 typedef const RECT
*LPCRECT
;
408 typedef struct tagRECTL
{
413 } RECTL
,*PRECTL
,*LPRECTL
;
414 typedef const RECTL
*LPCRECTL
;
415 typedef struct tagPOINT
{
418 } POINT
,POINTL
,*PPOINT
,*LPPOINT
,*PPOINTL
,*LPPOINTL
;
419 typedef struct tagSIZE
{
422 } SIZE
,SIZEL
,*PSIZE
,*LPSIZE
,*PSIZEL
,*LPSIZEL
;
423 typedef struct tagPOINTS
{
426 } POINTS
,*PPOINTS
,*LPPOINTS
;