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)
17 #if defined(__LP64__) || (!defined(_M_AMD64) && defined(__WINESRC__))
18 #if !defined(__ROS_LONG64__)
19 #define __ROS_LONG64__
33 #if defined(_MAC) && !defined(_WIN32)
47 #ifndef __ROS_LONG64__
48 typedef unsigned long ULONG
;
50 typedef unsigned int ULONG
;
52 typedef ULONG
*PULONG
;
53 typedef unsigned short USHORT
;
54 typedef USHORT
*PUSHORT
;
55 typedef unsigned char UCHAR
;
56 typedef UCHAR
*PUCHAR
;
59 #endif /* BASETYPES */
72 #define NULL ((void *)0)
84 #ifndef _NO_W32_PSEUDO_MODIFIERS
97 #define PACKED __attribute__((packed))
99 #define __declspec(e) __attribute__((e))
102 #define _declspec(e) __attribute__((e))
104 #elif defined(__WATCOMC__)
111 #define DECLSPEC_NORETURN __declspec(noreturn)
112 #define DECLARE_STDCALL_P( type ) __stdcall type
113 #elif defined(__WATCOMC__)
114 #define DECLSPEC_NORETURN
115 #define DECLARE_STDCALL_P( type ) type __stdcall
116 #elif defined(_MSC_VER)
117 #define DECLSPEC_NORETURN __declspec(noreturn)
118 #define DECLARE_STDCALL_P( type ) type __stdcall
119 #endif /* __GNUC__/__WATCOMC__ */
121 #define DECLSPEC_IMPORT __declspec(dllimport)
122 #define DECLSPEC_EXPORT __declspec(dllexport)
123 #ifndef DECLSPEC_NOINLINE
124 #if (_MSC_VER >= 1300)
125 #define DECLSPEC_NOINLINE __declspec(noinline)
126 #elif defined(__GNUC__)
127 #define DECLSPEC_NOINLINE __attribute__((noinline))
129 #define DECLSPEC_NOINLINE
139 #define pascal __stdcall
146 #if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
148 #define CALLBACK __stdcall
151 #define WINAPI __stdcall
153 #define WINAPIV __cdecl
154 #define APIENTRY WINAPI
155 #define APIPRIVATE WINAPI
156 #define PASCAL WINAPI
161 #define APIENTRY WINAPI
163 #define PASCAL pascal
175 #ifndef _DEF_WINBOOL_
176 #define _DEF_WINBOOL_
178 #pragma push_macro("BOOL")
180 #if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU)
185 typedef BOOL
*LPBOOL
;
186 #pragma pop_macro("BOOL")
187 #endif /* _DEF_WINBOOL_ */
189 typedef unsigned char BYTE
;
190 typedef unsigned short WORD
;
191 #ifndef __ROS_LONG64__
192 typedef unsigned long DWORD
;
194 typedef unsigned int DWORD
;
197 typedef FLOAT
*PFLOAT
;
199 typedef BYTE
*LPBYTE
;
203 typedef WORD
*LPWORD
;
204 #ifndef __ROS_LONG64__
205 typedef long *LPLONG
;
209 typedef DWORD
*PDWORD
;
210 typedef DWORD
*LPDWORD
;
211 typedef void *LPVOID
;
212 #ifndef _LPCVOID_DEFINED
213 #define _LPCVOID_DEFINED
214 typedef CONST
void *LPCVOID
;
217 typedef unsigned int UINT
;
218 typedef unsigned int *PUINT
;
219 typedef unsigned int *LPUINT
;
228 //#include <specstrings.h>
230 typedef UINT_PTR WPARAM
;
231 typedef LONG_PTR LPARAM
;
232 typedef LONG_PTR LRESULT
;
233 #ifndef _HRESULT_DEFINED
234 typedef LONG HRESULT
;
235 #define _HRESULT_DEFINED
240 #define max(a, b) (((a) > (b)) ? (a) : (b))
243 #define min(a, b) (((a) < (b)) ? (a) : (b))
247 #define MAKEWORD(bLow, bHigh) ((WORD)(((BYTE)((DWORD_PTR)(bLow) & 0xff )) | (((WORD)((BYTE)((DWORD_PTR)(bHigh) & 0xff))) << 8 )))
248 #define MAKELONG(wLow, wHigh) ((LONG)(((WORD)((DWORD_PTR)(wLow) & 0xffff)) | (((DWORD)((WORD)((DWORD_PTR)(wHigh) & 0xffff))) << 16)))
249 #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
250 #define HIWORD(l) ((WORD)(((DWORD_PTR)(l) >> 16) & 0xffff))
251 #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff))
252 #define HIBYTE(w) ((BYTE)(((DWORD_PTR)(w) >> 8) & 0xff))
255 DECLARE_HANDLE (HWND
);
256 //DECLARE_HANDLE (HHOOK);
258 DECLARE_HANDLE (HEVENT
);
264 typedef HANDLE
*SPHANDLE
;
265 typedef HANDLE
*LPHANDLE
;
266 typedef HANDLE HGLOBAL
;
267 typedef HANDLE HLOCAL
;
268 typedef HANDLE GLOBALHANDLE
;
269 typedef HANDLE LOCALHANDLE
;
271 typedef INT_PTR (WINAPI
*FARPROC
)();
272 typedef INT_PTR (WINAPI
*NEARPROC
)();
273 typedef INT_PTR (WINAPI
*PROC
)();
275 typedef int (WINAPI
*FARPROC
)();
276 typedef int (WINAPI
*NEARPROC
)();
277 typedef int (WINAPI
*PROC
)();
280 typedef void *HGDIOBJ
;
282 DECLARE_HANDLE(HKEY
);
285 DECLARE_HANDLE(HACCEL
);
286 DECLARE_HANDLE(HBITMAP
);
287 DECLARE_HANDLE(HBRUSH
);
288 DECLARE_HANDLE(HCOLORSPACE
);
290 DECLARE_HANDLE(HGLRC
);
291 DECLARE_HANDLE(HDESK
);
292 DECLARE_HANDLE(HENHMETAFILE
);
293 DECLARE_HANDLE(HFONT
);
294 DECLARE_HANDLE(HICON
);
295 DECLARE_HANDLE(HMENU
);
296 DECLARE_HANDLE(HMETAFILE
);
297 DECLARE_HANDLE(HINSTANCE
);
298 typedef HINSTANCE HMODULE
;
299 DECLARE_HANDLE(HPALETTE
);
300 DECLARE_HANDLE(HPEN
);
301 DECLARE_HANDLE(HRGN
);
302 DECLARE_HANDLE(HRSRC
);
303 DECLARE_HANDLE(HSTR
);
304 DECLARE_HANDLE(HTASK
);
305 DECLARE_HANDLE(HWINSTA
);
307 DECLARE_HANDLE(HMONITOR
);
308 DECLARE_HANDLE(HWINEVENTHOOK
);
309 DECLARE_HANDLE(HUMPD
);
312 typedef HICON HCURSOR
;
313 typedef DWORD COLORREF
;
314 typedef DWORD
*LPCOLORREF
;
316 #define HFILE_ERROR ((HFILE)-1)
318 typedef struct tagRECT
{
323 } RECT
,*PRECT
,*NPRECT
,*LPRECT
;
325 typedef const RECT
*LPCRECT
;
327 typedef struct _RECTL
{
332 } RECTL
,*PRECTL
,*LPRECTL
;
334 typedef const RECTL
*LPCRECTL
;
336 typedef struct tagPOINT
{
339 } POINT
,*PPOINT
,*NPPOINT
,*LPPOINT
;
341 typedef struct _POINTL
{
346 typedef struct tagSIZE
{
349 } SIZE
,*PSIZE
,*LPSIZE
;
352 typedef SIZE
*PSIZEL
,*LPSIZEL
;
354 typedef struct tagPOINTS
{
357 } POINTS
,*PPOINTS
,*LPPOINTS
;
359 typedef struct _FILETIME
{
361 DWORD dwHighDateTime
;
362 } FILETIME
,*PFILETIME
,*LPFILETIME
;
370 #define DM_IN_BUFFER DM_MODIFY
371 #define DM_IN_PROMPT DM_PROMPT
372 #define DM_OUT_BUFFER DM_COPY
373 #define DM_OUT_DEFAULT DM_UPDATE
377 #define DC_PAPERSIZE 3
378 #define DC_MINEXTENT 4
379 #define DC_MAXEXTENT 5
384 #define DC_VERSION 10
386 #define DC_BINNAMES 12
387 #define DC_ENUMRESOLUTIONS 13
388 #define DC_FILEDEPENDENCIES 14
389 #define DC_TRUETYPE 15
390 #define DC_PAPERNAMES 16
391 #define DC_ORIENTATION 17
394 /* needed by header files generated by WIDL */
396 #define WINE_NO_UNICODE_MACROS
399 #ifdef WINE_NO_UNICODE_MACROS
400 # define WINELIB_NAME_AW(func) \
401 func##_must_be_suffixed_with_W_or_A_in_this_context \
402 func##_must_be_suffixed_with_W_or_A_in_this_context
403 #else /* WINE_NO_UNICODE_MACROS */
405 # define WINELIB_NAME_AW(func) func##W
407 # define WINELIB_NAME_AW(func) func##A
409 #endif /* WINE_NO_UNICODE_MACROS */
411 #ifdef WINE_NO_UNICODE_MACROS
412 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
414 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
428 #define PACKED __attribute__((packed))
430 //#define _fastcall __attribute__((fastcall))
433 //#define __fastcall __attribute__((fastcall))
436 //#define _stdcall __attribute__((stdcall))
439 //#define __stdcall __attribute__((stdcall))
442 //#define _cdecl __attribute__((cdecl))
445 //#define __cdecl __attribute__((cdecl))
448 #define __declspec(e) __attribute__((e))
451 #define _declspec(e) __attribute__((e))
453 #elif defined(__WATCOMC__)
462 #if 1 // needed by shlwapi.h
464 # if defined(__x86_64__) && defined (__GNUC__)
465 # define __ms_va_list __builtin_ms_va_list
466 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
467 # define __ms_va_end(list) __builtin_ms_va_end(list)
469 # define __ms_va_list va_list
470 # define __ms_va_start(list,arg) va_start(list,arg)
471 # define __ms_va_end(list) va_end(list)
484 #endif /* _WINDEF_ */