2 * Basic types definitions
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_WINDEF_H
22 #define __WINE_WINDEF_H
32 #endif /* NO_STRICT */
38 /* Calling conventions definitions */
40 #if defined(__i386__) && !defined(_X86_)
47 # define __stdcall __attribute__((__stdcall__))
48 # elif defined(_MSC_VER)
49 /* Nothing needs to be done. __stdcall already exists */
51 # error You need to define __stdcall for your compiler
55 # endif /* __i386__ */
56 #endif /* __stdcall */
59 # if defined(__i386__) && defined(__GNUC__)
60 # define __cdecl __attribute__((__cdecl__))
61 # elif !defined(_MSC_VER)
64 #endif /* __stdcall */
67 #define __ONLY_IN_WINELIB(x) do_not_use_this_in_wine
69 #define __ONLY_IN_WINELIB(x) x
73 #define pascal __ONLY_IN_WINELIB(__stdcall)
76 #define _pascal __ONLY_IN_WINELIB(__stdcall)
79 #define _stdcall __ONLY_IN_WINELIB(__stdcall)
82 #define _fastcall __ONLY_IN_WINELIB(__stdcall)
85 #define __fastcall __ONLY_IN_WINELIB(__stdcall)
88 #define __export __ONLY_IN_WINELIB(__stdcall)
91 #define cdecl __ONLY_IN_WINELIB(__cdecl)
94 #define _cdecl __ONLY_IN_WINELIB(__cdecl)
98 #define near __ONLY_IN_WINELIB()
101 #define far __ONLY_IN_WINELIB()
104 #define _near __ONLY_IN_WINELIB()
107 #define _far __ONLY_IN_WINELIB()
110 #define NEAR __ONLY_IN_WINELIB()
113 #define FAR __ONLY_IN_WINELIB()
117 #define _declspec(x) __ONLY_IN_WINELIB()
120 #define __declspec(x) __ONLY_IN_WINELIB()
123 #define CALLBACK __stdcall
124 #define WINAPI __stdcall
125 #define APIPRIVATE __stdcall
126 #define PASCAL __stdcall
127 #define CDECL __cdecl
128 #define _CDECL __cdecl
129 #define WINAPIV __cdecl
130 #define APIENTRY WINAPI
133 /* Misc. constants. */
139 #define NULL ((void*)0)
164 /* Standard data types */
166 typedef void *LPVOID
;
167 typedef const void *LPCVOID
;
168 typedef int BOOL
, *PBOOL
, *LPBOOL
;
169 typedef unsigned char BYTE
, *PBYTE
, *LPBYTE
;
170 typedef unsigned char UCHAR
, *PUCHAR
;
171 typedef unsigned short WORD
, *PWORD
, *LPWORD
;
172 typedef unsigned short USHORT
, *PUSHORT
;
173 typedef int INT
, *PINT
, *LPINT
;
174 typedef unsigned int UINT
, *PUINT
;
175 typedef long *LPLONG
;
176 typedef unsigned long DWORD
, *PDWORD
, *LPDWORD
;
177 typedef unsigned long ULONG
, *PULONG
;
178 typedef float FLOAT
, *PFLOAT
;
182 /* Macros to map Winelib names to the correct implementation name */
183 /* Note that Winelib is purely Win32. */
186 # define WINELIB_NAME_AW(func) \
187 func##_must_be_suffixed_with_W_or_A_in_this_context \
188 func##_must_be_suffixed_with_W_or_A_in_this_context
189 #else /* __WINESRC__ */
191 # define WINELIB_NAME_AW(func) func##W
193 # define WINELIB_NAME_AW(func) func##A
194 # endif /* UNICODE */
195 #endif /* __WINESRC__ */
198 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
199 #else /* __WINESRC__ */
200 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
201 #endif /* __WINESRC__ */
204 /* Polymorphic types */
206 typedef UINT_PTR WPARAM
;
207 typedef LONG_PTR LPARAM
;
208 typedef LONG_PTR LRESULT
;
213 typedef DWORD COLORREF
, *LPCOLORREF
;
219 DECLARE_HANDLE(HACCEL
);
220 DECLARE_HANDLE(HBITMAP
);
221 DECLARE_HANDLE(HBRUSH
);
222 DECLARE_HANDLE(HCOLORSPACE
);
224 DECLARE_HANDLE(HDESK
);
225 DECLARE_HANDLE(HENHMETAFILE
);
226 DECLARE_HANDLE(HFONT
);
227 DECLARE_HANDLE(HHOOK
);
228 DECLARE_HANDLE(HICON
);
229 DECLARE_HANDLE(HINSTANCE
);
230 DECLARE_HANDLE(HKEY
);
233 DECLARE_HANDLE(HMENU
);
234 DECLARE_HANDLE(HMETAFILE
);
235 DECLARE_HANDLE(HMONITOR
);
236 DECLARE_HANDLE(HPALETTE
);
237 DECLARE_HANDLE(HPEN
);
238 DECLARE_HANDLE(HRGN
);
239 DECLARE_HANDLE(HRSRC
);
240 DECLARE_HANDLE(HTASK
);
241 DECLARE_HANDLE(HWINEVENTHOOK
);
242 DECLARE_HANDLE(HWINSTA
);
243 DECLARE_HANDLE(HWND
);
245 /* Handle types that must remain interchangeable even with strict on */
247 typedef HINSTANCE HMODULE
;
248 typedef HANDLE HGDIOBJ
;
249 typedef HANDLE HGLOBAL
;
250 typedef HANDLE HLOCAL
;
251 typedef HANDLE GLOBALHANDLE
;
252 typedef HANDLE LOCALHANDLE
;
253 typedef HICON HCURSOR
;
255 /* Callback function pointers types */
257 typedef INT (CALLBACK
*FARPROC
)();
258 typedef INT (CALLBACK
*PROC
)();
261 /* Macros to split words and longs. */
263 #define LOBYTE(w) ((BYTE)(WORD)(w))
264 #define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
266 #define LOWORD(l) ((WORD)(DWORD)(l))
267 #define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
269 #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
270 #define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
272 /* min and max macros */
275 #define max(a,b) (((a) > (b)) ? (a) : (b))
278 #define min(a,b) (((a) < (b)) ? (a) : (b))
280 #endif /* NOMINMAX */
282 #ifdef MAX_PATH /* Work-around for Mingw */
284 #endif /* MAX_PATH */
287 #define HFILE_ERROR ((HFILE)-1)
289 /* The SIZE structure */
290 typedef struct tagSIZE
294 } SIZE
, *PSIZE
, *LPSIZE
;
296 typedef SIZE SIZEL
, *PSIZEL
, *LPSIZEL
;
298 /* The POINT structure */
299 typedef struct tagPOINT
303 } POINT
, *PPOINT
, *LPPOINT
;
305 typedef struct _POINTL
311 /* The POINTS structure */
313 typedef struct tagPOINTS
317 } POINTS
, *PPOINTS
, *LPPOINTS
;
319 /* The RECT structure */
320 typedef struct tagRECT
326 } RECT
, *PRECT
, *LPRECT
;
327 typedef const RECT
*LPCRECT
;
329 typedef struct tagRECTL
335 } RECTL
, *PRECTL
, *LPRECTL
;
337 typedef const RECTL
*LPCRECTL
;
343 #endif /* __WINE_WINDEF_H */