2412dc75705636edc90659852f0f5b9142c031a7
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.
9 #define _WINDEF_H // wine ...
13 #pragma warning(disable:4255)
17 #if !defined(__ROS_LONG64__)
19 #define __ROS_LONG64__
34 #if defined(_MAC) && !defined(_WIN32)
48 #ifndef __ROS_LONG64__
49 typedef unsigned long ULONG
;
51 typedef unsigned int ULONG
;
53 typedef ULONG
*PULONG
;
54 typedef unsigned short USHORT
;
55 typedef USHORT
*PUSHORT
;
56 typedef unsigned char UCHAR
;
57 typedef UCHAR
*PUCHAR
;
60 #endif /* BASETYPES */
73 #define NULL ((void *)0)
85 #ifndef _NO_W32_PSEUDO_MODIFIERS
98 #define PACKED __attribute__((packed))
100 #define __declspec(e) __attribute__((e))
103 #define _declspec(e) __attribute__((e))
105 #elif defined(__WATCOMC__)
114 #define DECLSPEC_NORETURN __declspec(noreturn)
115 #define DECLARE_STDCALL_P( type ) __stdcall type
116 #elif defined(__WATCOMC__)
117 #define DECLSPEC_NORETURN
118 #define DECLARE_STDCALL_P( type ) type __stdcall
119 #elif defined(_MSC_VER)
120 #define DECLSPEC_NORETURN __declspec(noreturn)
121 #define DECLARE_STDCALL_P( type ) type __stdcall
122 #endif /* __GNUC__/__WATCOMC__ */
124 #define DECLSPEC_IMPORT __declspec(dllimport)
125 #define DECLSPEC_EXPORT __declspec(dllexport)
126 #ifndef DECLSPEC_NOINLINE
127 #if (_MSC_VER >= 1300)
128 #define DECLSPEC_NOINLINE __declspec(noinline)
129 #elif defined(__GNUC__)
130 #define DECLSPEC_NOINLINE __attribute__((noinline))
132 #define DECLSPEC_NOINLINE
142 #define pascal __stdcall
144 //#define cdecl _cdecl
149 #if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
151 #define CALLBACK __stdcall
154 #define WINAPI __stdcall
156 #define WINAPIV __cdecl
157 #define APIENTRY WINAPI
158 #define APIPRIVATE WINAPI
159 #define PASCAL WINAPI
164 #define APIENTRY WINAPI
166 #define PASCAL pascal
178 #ifndef _DEF_WINBOOL_
179 #define _DEF_WINBOOL_
181 #pragma push_macro("BOOL")
183 #if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU)
188 typedef BOOL
*LPBOOL
;
189 #pragma pop_macro("BOOL")
190 #endif /* _DEF_WINBOOL_ */
192 typedef unsigned char BYTE
;
193 typedef unsigned short WORD
;
194 #ifndef __ROS_LONG64__
195 typedef unsigned long DWORD
;
197 typedef unsigned int DWORD
;
200 typedef FLOAT
*PFLOAT
;
202 typedef BYTE
*LPBYTE
;
206 typedef WORD
*LPWORD
;
207 #ifndef __ROS_LONG64__
208 typedef long *LPLONG
;
212 typedef DWORD
*PDWORD
;
213 typedef DWORD
*LPDWORD
;
214 typedef void *LPVOID
;
215 #ifndef _LPCVOID_DEFINED
216 #define _LPCVOID_DEFINED
217 typedef CONST
void *LPCVOID
;
220 typedef unsigned int UINT
;
221 typedef unsigned int *PUINT
;
222 typedef unsigned int *LPUINT
;
231 #include <specstrings.h>
233 typedef UINT_PTR WPARAM
;
234 typedef LONG_PTR LPARAM
;
235 typedef LONG_PTR LRESULT
;
236 #ifndef _HRESULT_DEFINED
237 typedef LONG HRESULT
;
238 #define _HRESULT_DEFINED
243 #define max(a,b) (((a) > (b)) ? (a) : (b))
246 #define min(a,b) (((a) < (b)) ? (a) : (b))
250 #define MAKEWORD(a,b) ((WORD)(((BYTE)((DWORD_PTR)(a) & 0xff)) | ((WORD)((BYTE)((DWORD_PTR)(b) & 0xff))) << 8))
251 #define MAKELONG(a,b) ((LONG)(((WORD)((DWORD_PTR)(a) & 0xffff)) | ((DWORD)((WORD)((DWORD_PTR)(b) & 0xffff))) << 16))
252 #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
253 #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))
254 #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff))
255 #define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8))
258 DECLARE_HANDLE (HWND
);
259 //DECLARE_HANDLE (HHOOK);
261 DECLARE_HANDLE (HEVENT
);
267 typedef HANDLE
*SPHANDLE
;
268 typedef HANDLE
*LPHANDLE
;
269 typedef HANDLE HGLOBAL
;
270 typedef HANDLE HLOCAL
;
271 typedef HANDLE GLOBALHANDLE
;
272 typedef HANDLE LOCALHANDLE
;
274 typedef INT_PTR (WINAPI
*FARPROC
)();
275 typedef INT_PTR (WINAPI
*NEARPROC
)();
276 typedef INT_PTR (WINAPI
*PROC
)();
278 typedef int (WINAPI
*FARPROC
)();
279 typedef int (WINAPI
*NEARPROC
)();
280 typedef int (WINAPI
*PROC
)();
283 typedef void *HGDIOBJ
;
285 DECLARE_HANDLE(HKEY
);
288 DECLARE_HANDLE(HACCEL
);
289 DECLARE_HANDLE(HBITMAP
);
290 DECLARE_HANDLE(HBRUSH
);
291 DECLARE_HANDLE(HCOLORSPACE
);
293 DECLARE_HANDLE(HGLRC
);
294 DECLARE_HANDLE(HDESK
);
295 DECLARE_HANDLE(HENHMETAFILE
);
296 DECLARE_HANDLE(HFONT
);
297 DECLARE_HANDLE(HICON
);
298 DECLARE_HANDLE(HMENU
);
299 DECLARE_HANDLE(HMETAFILE
);
300 DECLARE_HANDLE(HINSTANCE
);
301 typedef HINSTANCE HMODULE
;
302 DECLARE_HANDLE(HPALETTE
);
303 DECLARE_HANDLE(HPEN
);
304 DECLARE_HANDLE(HRGN
);
305 DECLARE_HANDLE(HRSRC
);
306 DECLARE_HANDLE(HSTR
);
307 DECLARE_HANDLE(HTASK
);
308 DECLARE_HANDLE(HWINSTA
);
310 DECLARE_HANDLE(HMONITOR
);
311 DECLARE_HANDLE(HWINEVENTHOOK
);
312 DECLARE_HANDLE(HUMPD
);
315 typedef HICON HCURSOR
;
316 typedef DWORD COLORREF
;
317 typedef DWORD
*LPCOLORREF
;
319 #define HFILE_ERROR ((HFILE)-1)
321 typedef struct tagRECT
{
326 } RECT
,*PRECT
,*NPRECT
,*LPRECT
;
328 typedef const RECT
*LPCRECT
;
330 typedef struct _RECTL
{
335 } RECTL
,*PRECTL
,*LPRECTL
;
337 typedef const RECTL
*LPCRECTL
;
339 typedef struct tagPOINT
{
342 } POINT
,*PPOINT
,*NPPOINT
,*LPPOINT
;
344 typedef struct _POINTL
{
349 typedef struct tagSIZE
{
352 } SIZE
,*PSIZE
,*LPSIZE
;
355 typedef SIZE
*PSIZEL
,*LPSIZEL
;
357 typedef struct tagPOINTS
{
360 } POINTS
,*PPOINTS
,*LPPOINTS
;
362 typedef struct _FILETIME
{
364 DWORD dwHighDateTime
;
365 } FILETIME
,*PFILETIME
,*LPFILETIME
;
373 #define DM_IN_BUFFER DM_MODIFY
374 #define DM_IN_PROMPT DM_PROMPT
375 #define DM_OUT_BUFFER DM_COPY
376 #define DM_OUT_DEFAULT DM_UPDATE
380 #define DC_PAPERSIZE 3
381 #define DC_MINEXTENT 4
382 #define DC_MAXEXTENT 5
387 #define DC_VERSION 10
389 #define DC_BINNAMES 12
390 #define DC_ENUMRESOLUTIONS 13
391 #define DC_FILEDEPENDENCIES 14
392 #define DC_TRUETYPE 15
393 #define DC_PAPERNAMES 16
394 #define DC_ORIENTATION 17
397 /* needed by header files generated by WIDL */
399 #define WINE_NO_UNICODE_MACROS
402 #ifdef WINE_NO_UNICODE_MACROS
403 # define WINELIB_NAME_AW(func) \
404 func##_must_be_suffixed_with_W_or_A_in_this_context \
405 func##_must_be_suffixed_with_W_or_A_in_this_context
406 #else /* WINE_NO_UNICODE_MACROS */
408 # define WINELIB_NAME_AW(func) func##W
410 # define WINELIB_NAME_AW(func) func##A
412 #endif /* WINE_NO_UNICODE_MACROS */
414 #ifdef WINE_NO_UNICODE_MACROS
415 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
417 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
420 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
421 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
422 #define DBG_UNREFERENCED_PARAMETER(P)
423 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
436 #define PACKED __attribute__((packed))
438 //#define _fastcall __attribute__((fastcall))
441 //#define __fastcall __attribute__((fastcall))
444 //#define _stdcall __attribute__((stdcall))
447 //#define __stdcall __attribute__((stdcall))
450 //#define _cdecl __attribute__((cdecl))
453 //#define __cdecl __attribute__((cdecl))
456 #define __declspec(e) __attribute__((e))
459 #define _declspec(e) __attribute__((e))
461 #elif defined(__WATCOMC__)
470 #if 1 // needed by shlwapi.h
472 # if defined(__x86_64__) && defined (__GNUC__)
473 # define __ms_va_list __builtin_ms_va_list
474 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
475 # define __ms_va_end(list) __builtin_ms_va_end(list)
477 # define __ms_va_list va_list
478 # define __ms_va_start(list,arg) va_start(list,arg)
479 # define __ms_va_end(list) va_end(list)
492 #endif /* _WINDEF_ */