2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
10 #define _WINDEF_H // wine ...
14 #pragma warning(disable:4255)
18 #if !defined(__ROS_LONG64__)
20 #define __ROS_LONG64__
35 #if defined(_MAC) && !defined(_WIN32)
49 #ifndef __ROS_LONG64__
50 typedef unsigned long ULONG
;
52 typedef unsigned int ULONG
;
54 typedef ULONG
*PULONG
;
55 typedef unsigned short USHORT
;
56 typedef USHORT
*PUSHORT
;
57 typedef unsigned char UCHAR
;
58 typedef UCHAR
*PUCHAR
;
61 #endif /* BASETYPES */
74 #define NULL ((void *)0)
86 #ifndef _NO_W32_PSEUDO_MODIFIERS
99 #define PACKED __attribute__((packed))
101 #define __declspec(e) __attribute__((e))
104 #define _declspec(e) __attribute__((e))
106 #elif defined(__WATCOMC__)
113 #define DECLSPEC_NORETURN __declspec(noreturn)
114 #define DECLARE_STDCALL_P( type ) __stdcall type
115 #elif defined(__WATCOMC__)
116 #define DECLSPEC_NORETURN
117 #define DECLARE_STDCALL_P( type ) type __stdcall
118 #elif defined(_MSC_VER)
119 #define DECLSPEC_NORETURN __declspec(noreturn)
120 #define DECLARE_STDCALL_P( type ) type __stdcall
121 #endif /* __GNUC__/__WATCOMC__ */
123 #define DECLSPEC_IMPORT __declspec(dllimport)
124 #define DECLSPEC_EXPORT __declspec(dllexport)
125 #ifndef DECLSPEC_NOINLINE
126 #if (_MSC_VER >= 1300)
127 #define DECLSPEC_NOINLINE __declspec(noinline)
128 #elif defined(__GNUC__)
129 #define DECLSPEC_NOINLINE __attribute__((noinline))
131 #define DECLSPEC_NOINLINE
141 #define pascal __stdcall
148 #if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
150 #define CALLBACK __stdcall
153 #define WINAPI __stdcall
155 #define WINAPIV __cdecl
156 #define APIENTRY WINAPI
157 #define APIPRIVATE WINAPI
158 #define PASCAL WINAPI
163 #define APIENTRY WINAPI
165 #define PASCAL pascal
177 #ifndef _DEF_WINBOOL_
178 #define _DEF_WINBOOL_
180 #pragma push_macro("BOOL")
182 #if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU)
187 typedef BOOL
*LPBOOL
;
188 #pragma pop_macro("BOOL")
189 #endif /* _DEF_WINBOOL_ */
191 typedef unsigned char BYTE
;
192 typedef unsigned short WORD
;
193 #ifndef __ROS_LONG64__
194 typedef unsigned long DWORD
;
196 typedef unsigned int DWORD
;
199 typedef FLOAT
*PFLOAT
;
201 typedef BYTE
*LPBYTE
;
205 typedef WORD
*LPWORD
;
206 #ifndef __ROS_LONG64__
207 typedef long *LPLONG
;
211 typedef DWORD
*PDWORD
;
212 typedef DWORD
*LPDWORD
;
213 typedef void *LPVOID
;
214 #ifndef _LPCVOID_DEFINED
215 #define _LPCVOID_DEFINED
216 typedef CONST
void *LPCVOID
;
219 typedef unsigned int UINT
;
220 typedef unsigned int *PUINT
;
221 typedef unsigned int *LPUINT
;
230 //#include <specstrings.h>
232 typedef UINT_PTR WPARAM
;
233 typedef LONG_PTR LPARAM
;
234 typedef LONG_PTR LRESULT
;
235 #ifndef _HRESULT_DEFINED
236 typedef LONG HRESULT
;
237 #define _HRESULT_DEFINED
242 #define max(a, b) (((a) > (b)) ? (a) : (b))
245 #define min(a, b) (((a) < (b)) ? (a) : (b))
249 #define MAKEWORD(bLow, bHigh) ((WORD)(((BYTE)((DWORD_PTR)(bLow) & 0xff )) | (((WORD)((BYTE)((DWORD_PTR)(bHigh) & 0xff))) << 8 )))
250 #define MAKELONG(wLow, wHigh) ((LONG)(((WORD)((DWORD_PTR)(wLow) & 0xffff)) | (((DWORD)((WORD)((DWORD_PTR)(wHigh) & 0xffff))) << 16)))
251 #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
252 #define HIWORD(l) ((WORD)(((DWORD_PTR)(l) >> 16) & 0xffff))
253 #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff))
254 #define HIBYTE(w) ((BYTE)(((DWORD_PTR)(w) >> 8) & 0xff))
257 DECLARE_HANDLE (HWND
);
258 //DECLARE_HANDLE (HHOOK);
260 DECLARE_HANDLE (HEVENT
);
266 typedef HANDLE
*SPHANDLE
;
267 typedef HANDLE
*LPHANDLE
;
268 typedef HANDLE HGLOBAL
;
269 typedef HANDLE HLOCAL
;
270 typedef HANDLE GLOBALHANDLE
;
271 typedef HANDLE LOCALHANDLE
;
273 typedef INT_PTR (WINAPI
*FARPROC
)();
274 typedef INT_PTR (WINAPI
*NEARPROC
)();
275 typedef INT_PTR (WINAPI
*PROC
)();
277 typedef int (WINAPI
*FARPROC
)();
278 typedef int (WINAPI
*NEARPROC
)();
279 typedef int (WINAPI
*PROC
)();
282 typedef void *HGDIOBJ
;
284 DECLARE_HANDLE(HKEY
);
287 DECLARE_HANDLE(HACCEL
);
288 DECLARE_HANDLE(HBITMAP
);
289 DECLARE_HANDLE(HBRUSH
);
290 DECLARE_HANDLE(HCOLORSPACE
);
292 DECLARE_HANDLE(HGLRC
);
293 DECLARE_HANDLE(HDESK
);
294 DECLARE_HANDLE(HENHMETAFILE
);
295 DECLARE_HANDLE(HFONT
);
296 DECLARE_HANDLE(HICON
);
297 DECLARE_HANDLE(HMENU
);
298 DECLARE_HANDLE(HMETAFILE
);
299 DECLARE_HANDLE(HINSTANCE
);
300 typedef HINSTANCE HMODULE
;
301 DECLARE_HANDLE(HPALETTE
);
302 DECLARE_HANDLE(HPEN
);
303 DECLARE_HANDLE(HRGN
);
304 DECLARE_HANDLE(HRSRC
);
305 DECLARE_HANDLE(HSTR
);
306 DECLARE_HANDLE(HTASK
);
307 DECLARE_HANDLE(HWINSTA
);
309 DECLARE_HANDLE(HMONITOR
);
310 DECLARE_HANDLE(HWINEVENTHOOK
);
311 DECLARE_HANDLE(HUMPD
);
314 typedef HICON HCURSOR
;
315 typedef DWORD COLORREF
;
316 typedef DWORD
*LPCOLORREF
;
318 #define HFILE_ERROR ((HFILE)-1)
320 typedef struct tagRECT
{
325 } RECT
,*PRECT
,*NPRECT
,*LPRECT
;
327 typedef const RECT
*LPCRECT
;
329 typedef struct _RECTL
{
334 } RECTL
,*PRECTL
,*LPRECTL
;
336 typedef const RECTL
*LPCRECTL
;
338 typedef struct tagPOINT
{
341 } POINT
,*PPOINT
,*NPPOINT
,*LPPOINT
;
343 typedef struct _POINTL
{
348 typedef struct tagSIZE
{
351 } SIZE
,*PSIZE
,*LPSIZE
;
354 typedef SIZE
*PSIZEL
,*LPSIZEL
;
356 typedef struct tagPOINTS
{
359 } POINTS
,*PPOINTS
,*LPPOINTS
;
361 typedef struct _FILETIME
{
363 DWORD dwHighDateTime
;
364 } FILETIME
,*PFILETIME
,*LPFILETIME
;
372 #define DM_IN_BUFFER DM_MODIFY
373 #define DM_IN_PROMPT DM_PROMPT
374 #define DM_OUT_BUFFER DM_COPY
375 #define DM_OUT_DEFAULT DM_UPDATE
379 #define DC_PAPERSIZE 3
380 #define DC_MINEXTENT 4
381 #define DC_MAXEXTENT 5
386 #define DC_VERSION 10
388 #define DC_BINNAMES 12
389 #define DC_ENUMRESOLUTIONS 13
390 #define DC_FILEDEPENDENCIES 14
391 #define DC_TRUETYPE 15
392 #define DC_PAPERNAMES 16
393 #define DC_ORIENTATION 17
396 /* needed by header files generated by WIDL */
398 #define WINE_NO_UNICODE_MACROS
401 #ifdef WINE_NO_UNICODE_MACROS
402 # define WINELIB_NAME_AW(func) \
403 func##_must_be_suffixed_with_W_or_A_in_this_context \
404 func##_must_be_suffixed_with_W_or_A_in_this_context
405 #else /* WINE_NO_UNICODE_MACROS */
407 # define WINELIB_NAME_AW(func) func##W
409 # define WINELIB_NAME_AW(func) func##A
411 #endif /* WINE_NO_UNICODE_MACROS */
413 #ifdef WINE_NO_UNICODE_MACROS
414 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
416 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
430 #define PACKED __attribute__((packed))
432 //#define _fastcall __attribute__((fastcall))
435 //#define __fastcall __attribute__((fastcall))
438 //#define _stdcall __attribute__((stdcall))
441 //#define __stdcall __attribute__((stdcall))
444 //#define _cdecl __attribute__((cdecl))
447 //#define __cdecl __attribute__((cdecl))
450 #define __declspec(e) __attribute__((e))
453 #define _declspec(e) __attribute__((e))
455 #elif defined(__WATCOMC__)
464 #if 1 // needed by shlwapi.h
466 # if defined(__x86_64__) && defined (__GNUC__)
467 # define __ms_va_list __builtin_ms_va_list
468 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
469 # define __ms_va_end(list) __builtin_ms_va_end(list)
471 # define __ms_va_list va_list
472 # define __ms_va_start(list,arg) va_start(list,arg)
473 # define __ms_va_end(list) va_end(list)
486 #endif /* _WINDEF_ */