Futher changes to casts
[tinycc/daniel.git] / win32 / include / winapi / windef.h
blob1ee3f39f62d7487ba7a4ef447cb9a5d8c69f26ad
1 #ifndef _WINDEF_H
2 #define _WINDEF_H
3 #if __GNUC__ >=3
4 #pragma GCC system_header
5 #endif
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 #ifndef WINVER
12 #define WINVER 0x0400
13 #endif
14 #ifndef _WIN32_WINNT
15 #define _WIN32_WINNT WINVER
16 #endif
17 #ifndef WIN32
18 #define WIN32
19 #endif
20 #ifndef _WIN32
21 #define _WIN32
22 #endif
23 #define FAR
24 #define far
25 #define NEAR
26 #define near
27 #ifndef CONST
28 #define CONST const
29 #endif
30 #undef MAX_PATH
31 #define MAX_PATH 260
33 #ifndef NULL
34 #ifdef __cplusplus
35 #define NULL 0
36 #else
37 #define NULL ((void*)0)
38 #endif
39 #endif
40 #ifndef FALSE
41 #define FALSE 0
42 #endif
43 #ifndef TRUE
44 #define TRUE 1
45 #endif
46 #define IN
47 #define OUT
48 #ifndef OPTIONAL
49 #define OPTIONAL
50 #endif
52 #ifdef __GNUC__
53 #define PACKED __attribute__((packed))
54 #ifndef _stdcall
55 #define _stdcall __attribute__((stdcall))
56 #endif
57 #ifndef __stdcall
58 #define __stdcall __attribute__((stdcall))
59 #endif
60 #ifndef _cdecl
61 #define _cdecl __attribute__((cdecl))
62 #endif
63 #ifndef __cdecl
64 #define __cdecl __attribute__((cdecl))
65 #endif
66 #ifndef __declspec
67 #define __declspec(e) __attribute__((e))
68 #endif
69 #ifndef _declspec
70 #define _declspec(e) __attribute__((e))
71 #endif
72 #else
73 #define PACKED
74 #define _cdecl
75 #define __cdecl
76 #endif
78 #undef pascal
79 #undef _pascal
80 #undef __pascal
81 #define pascal __stdcall
82 #define _pascal __stdcall
83 #define __pascal __stdcall
84 #define PASCAL _pascal
85 #define CDECL _cdecl
86 #define STDCALL __stdcall
87 #define WINAPI __stdcall
88 #define WINAPIV __cdecl
89 #define APIENTRY __stdcall
90 #define CALLBACK __stdcall
91 #define APIPRIVATE __stdcall
93 #define DECLSPEC_IMPORT __declspec(dllimport)
94 #define DECLSPEC_EXPORT __declspec(dllexport)
95 #ifdef __GNUC__
96 #define DECLSPEC_NORETURN __declspec(noreturn)
97 #define DECLARE_STDCALL_P( type ) __stdcall type
98 #elif defined(__WATCOMC__)
99 #define DECLSPEC_NORETURN
100 #define DECLARE_STDCALL_P( type ) type __stdcall
101 #endif /* __GNUC__/__WATCOMC__ */
102 #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
103 #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
104 #define LOWORD(l) ((WORD)((DWORD)(l)))
105 #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
106 #define LOBYTE(w) ((BYTE)(w))
107 #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
109 #ifndef _export
110 #define _export
111 #endif
112 #ifndef __export
113 #define __export
114 #endif
116 #ifndef NOMINMAX
117 #ifndef max
118 #define max(a,b) ((a)>(b)?(a):(b))
119 #endif
120 #ifndef min
121 #define min(a,b) ((a)<(b)?(a):(b))
122 #endif
123 #endif
125 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
126 #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
127 #define DBG_UNREFERENCED_PARAMETER(P)
128 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
130 typedef unsigned long DWORD;
131 typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
132 /* FIXME: Is there a good solution to this? */
133 #ifndef XFree86Server
134 #ifndef __OBJC__
135 typedef WINBOOL BOOL;
136 #else
137 #define BOOL WINBOOL
138 #endif
139 typedef unsigned char BYTE;
140 #endif /* ndef XFree86Server */
141 typedef BOOL *PBOOL,*LPBOOL;
142 typedef unsigned short WORD;
143 typedef float FLOAT;
144 typedef FLOAT *PFLOAT;
145 typedef BYTE *PBYTE,*LPBYTE;
146 typedef int *PINT,*LPINT;
147 typedef WORD *PWORD,*LPWORD;
148 typedef long *LPLONG;
149 typedef DWORD *PDWORD,*LPDWORD;
150 typedef void *PVOID,*LPVOID;
151 typedef CONST void *PCVOID,*LPCVOID;
152 typedef int INT;
153 typedef unsigned int UINT,*PUINT,*LPUINT;
155 #include <winnt.h>
157 typedef UINT WPARAM;
158 typedef LONG LPARAM;
159 typedef LONG LRESULT;
160 #ifndef _HRESULT_DEFINED
161 typedef LONG HRESULT;
162 #define _HRESULT_DEFINED
163 #endif
164 #ifndef XFree86Server
165 typedef WORD ATOM;
166 #endif /* XFree86Server */
167 typedef HANDLE HGLOBAL;
168 typedef HANDLE HLOCAL;
169 typedef HANDLE GLOBALHANDLE;
170 typedef HANDLE LOCALHANDLE;
171 typedef void *HGDIOBJ;
172 DECLARE_HANDLE(HACCEL);
173 DECLARE_HANDLE(HBITMAP);
174 DECLARE_HANDLE(HBRUSH);
175 DECLARE_HANDLE(HCOLORSPACE);
176 DECLARE_HANDLE(HDC);
177 DECLARE_HANDLE(HGLRC);
178 DECLARE_HANDLE(HDESK);
179 DECLARE_HANDLE(HENHMETAFILE);
180 DECLARE_HANDLE(HFONT);
181 DECLARE_HANDLE(HICON);
182 DECLARE_HANDLE(HKEY);
183 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
184 /* #if (WINVER >= 0x0500) */
185 DECLARE_HANDLE(HMONITOR);
186 #define HMONITOR_DECLARED 1
187 DECLARE_HANDLE(HTERMINAL);
188 DECLARE_HANDLE(HWINEVENTHOOK);
189 /* #endif */
190 typedef HKEY *PHKEY;
191 DECLARE_HANDLE(HMENU);
192 DECLARE_HANDLE(HMETAFILE);
193 DECLARE_HANDLE(HINSTANCE);
194 typedef HINSTANCE HMODULE;
195 DECLARE_HANDLE(HPALETTE);
196 DECLARE_HANDLE(HPEN);
197 DECLARE_HANDLE(HRGN);
198 DECLARE_HANDLE(HRSRC);
199 DECLARE_HANDLE(HSTR);
200 DECLARE_HANDLE(HTASK);
201 DECLARE_HANDLE(HWND);
202 DECLARE_HANDLE(HWINSTA);
203 DECLARE_HANDLE(HKL);
204 typedef int HFILE;
205 typedef HICON HCURSOR;
206 typedef DWORD COLORREF;
207 typedef int (WINAPI *FARPROC)();
208 typedef int (WINAPI *NEARPROC)();
209 typedef int (WINAPI *PROC)();
210 typedef struct tagRECT {
211 LONG left;
212 LONG top;
213 LONG right;
214 LONG bottom;
215 } RECT,*PRECT,*LPRECT;
216 typedef const RECT *LPCRECT;
217 typedef struct tagRECTL {
218 LONG left;
219 LONG top;
220 LONG right;
221 LONG bottom;
222 } RECTL,*PRECTL,*LPRECTL;
223 typedef const RECTL *LPCRECTL;
224 typedef struct tagPOINT {
225 LONG x;
226 LONG y;
227 } POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
228 typedef struct tagSIZE {
229 LONG cx;
230 LONG cy;
231 } SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
232 typedef struct tagPOINTS {
233 SHORT x;
234 SHORT y;
235 } POINTS,*PPOINTS,*LPPOINTS;
237 #ifdef __cplusplus
239 #endif
240 #endif