Mercurial > mplayer.hg
annotate loader/wine/windef.h @ 25101:10a3f5b4ee20
Rename timer-lx.c --> timer-linux.c.
author | diego |
---|---|
date | Wed, 21 Nov 2007 09:25:10 +0000 |
parents | c98c9e7f3bd0 |
children | 2c8cdb9123b8 |
rev | line source |
---|---|
1 | 1 /* |
2 * Basic types definitions | |
3 * | |
4 * Copyright 1996 Alexandre Julliard | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
5 * |
18783 | 6 * Modified for use with MPlayer, detailed changelog at |
7 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
8 * $Id$ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
9 * |
1 | 10 */ |
11 | |
24422
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
12 #ifndef WINE_WINDEF_H |
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
13 #define WINE_WINDEF_H |
1 | 14 |
15 # include "config.h" | |
16 | |
17 #ifdef _EGCS_ | |
18 #define __stdcall | |
19 #endif | |
20 | |
21 #ifdef __cplusplus | |
22 extern "C" { | |
23 #endif | |
24 | |
25 /* Misc. constants. */ | |
26 | |
27 #ifdef FALSE | |
28 #undef FALSE | |
29 #endif | |
30 #define FALSE 0 | |
31 | |
32 #ifdef TRUE | |
33 #undef TRUE | |
34 #endif | |
35 #define TRUE 1 | |
36 | |
37 #ifdef NULL | |
38 #undef NULL | |
39 #endif | |
40 #define NULL 0 | |
41 | |
42 /* Macros to map Winelib names to the correct implementation name */ | |
43 /* Note that Winelib is purely Win32. */ | |
44 | |
45 # define WINELIB_NAME_AW(func) \ | |
46 func##_must_be_suffixed_with_W_or_A_in_this_context \ | |
47 func##_must_be_suffixed_with_W_or_A_in_this_context | |
48 | |
49 # define DECL_WINELIB_TYPE_AW(type) /* nothing */ | |
50 | |
51 #ifndef NONAMELESSSTRUCT | |
52 # define NONAMELESSSTRUCT | |
53 #endif /* !defined(NONAMELESSSTRUCT) */ | |
54 | |
55 #ifndef NONAMELESSUNION | |
56 # define NONAMELESSUNION | |
57 #endif /* !defined(NONAMELESSUNION) */ | |
58 | |
59 #ifndef NONAMELESSSTRUCT | |
60 #define DUMMYSTRUCTNAME | |
61 #define DUMMYSTRUCTNAME1 | |
62 #define DUMMYSTRUCTNAME2 | |
63 #define DUMMYSTRUCTNAME3 | |
64 #define DUMMYSTRUCTNAME4 | |
65 #define DUMMYSTRUCTNAME5 | |
66 #else /* !defined(NONAMELESSSTRUCT) */ | |
67 #define DUMMYSTRUCTNAME s | |
68 #define DUMMYSTRUCTNAME1 s1 | |
69 #define DUMMYSTRUCTNAME2 s2 | |
70 #define DUMMYSTRUCTNAME3 s3 | |
71 #define DUMMYSTRUCTNAME4 s4 | |
72 #define DUMMYSTRUCTNAME5 s5 | |
73 #endif /* !defined(NONAMELESSSTRUCT) */ | |
74 | |
75 #ifndef NONAMELESSUNION | |
76 #define DUMMYUNIONNAME | |
77 #define DUMMYUNIONNAME1 | |
78 #define DUMMYUNIONNAME2 | |
79 #define DUMMYUNIONNAME3 | |
80 #define DUMMYUNIONNAME4 | |
81 #define DUMMYUNIONNAME5 | |
82 #else /* !defined(NONAMELESSUNION) */ | |
83 #define DUMMYUNIONNAME u | |
84 #define DUMMYUNIONNAME1 u1 | |
85 #define DUMMYUNIONNAME2 u2 | |
86 #define DUMMYUNIONNAME3 u3 | |
87 #define DUMMYUNIONNAME4 u4 | |
88 #define DUMMYUNIONNAME5 u5 | |
89 #endif /* !defined(NONAMELESSUNION) */ | |
90 | |
91 /* Calling conventions definitions */ | |
92 | |
93 #ifdef __i386__ | |
94 # if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) | |
95 # ifndef _EGCS_ | |
96 #define __stdcall __attribute__((__stdcall__)) | |
97 #define __cdecl __attribute__((__cdecl__)) | |
98 # define __RESTORE_ES __asm__ __volatile__("pushl %ds\n\tpopl %es") | |
99 # endif | |
100 # else | |
186 | 101 // # error You need gcc >= 2.7 to build Wine on a 386 |
1 | 102 # endif |
103 #else | |
104 # define __stdcall | |
105 # define __cdecl | |
106 # define __RESTORE_ES | |
107 #endif | |
108 | |
109 #define CALLBACK __stdcall | |
110 #define WINAPI __stdcall | |
111 #define APIPRIVATE __stdcall | |
112 #define PASCAL __stdcall | |
113 #define pascal __stdcall | |
114 #define _pascal __stdcall | |
9978 | 115 #if !defined(__CYGWIN__) && !defined(__MINGW32__) |
1 | 116 #define _stdcall __stdcall |
117 #define _fastcall __stdcall | |
118 #define __fastcall __stdcall | |
7182
0bfd137f492a
fix some warnings on cygwin, patch by Sylvain Petreolle <spetreolle@yahoo.fr>
atmos4
parents:
6302
diff
changeset
|
119 #endif |
1 | 120 #define __export __stdcall |
121 #define CDECL __cdecl | |
122 #define _CDECL __cdecl | |
123 #define cdecl __cdecl | |
9978 | 124 #if !defined(__CYGWIN__) && !defined(__MINGW32__) |
1 | 125 #define _cdecl __cdecl |
6302
aa9aca7772de
cygwin & darwin fixes by Joey Parrish <joey@yunamusic.com>
arpi
parents:
3548
diff
changeset
|
126 #endif |
1 | 127 #define WINAPIV __cdecl |
128 #define APIENTRY WINAPI | |
129 | |
9978 | 130 #if !defined(__CYGWIN__) && !defined(__MINGW32__) |
1 | 131 #define __declspec(x) |
6302
aa9aca7772de
cygwin & darwin fixes by Joey Parrish <joey@yunamusic.com>
arpi
parents:
3548
diff
changeset
|
132 #endif |
1 | 133 #define dllimport |
134 #define dllexport | |
135 | |
136 #define CONST const | |
137 | |
138 /* Standard data types. These are the same for emulator and library. */ | |
139 | |
140 typedef void VOID; | |
141 typedef int INT; | |
142 typedef unsigned int UINT; | |
143 typedef unsigned short WORD; | |
13182 | 144 typedef unsigned long DWORD; |
145 typedef unsigned long ULONG; | |
1 | 146 typedef unsigned char BYTE; |
147 typedef long LONG; | |
148 typedef short SHORT; | |
149 typedef unsigned short USHORT; | |
150 typedef char CHAR; | |
151 typedef unsigned char UCHAR; | |
152 | |
153 typedef LONG SCODE; | |
154 | |
155 /* Some systems might have wchar_t, but we really need 16 bit characters */ | |
156 typedef unsigned short WCHAR; | |
157 typedef int WIN_BOOL; | |
158 typedef double DATE; | |
159 typedef double DOUBLE; | |
128 | 160 typedef long long LONGLONG; |
161 typedef unsigned long long ULONGLONG; | |
1 | 162 |
163 /* FIXME: Wine does not compile with strict on, therefore strict | |
164 * handles are presently only usable on machines where sizeof(UINT) == | |
165 * sizeof(void*). HANDLEs are supposed to be void* but a large amount | |
166 * of WINE code operates on HANDLES as if they are UINTs. So to WINE | |
167 * they exist as UINTs but to the Winelib user who turns on strict, | |
168 * they exist as void*. If there is a size difference between UINT and | |
169 * void* then things get ugly. */ | |
170 #ifdef STRICT | |
171 typedef VOID* HANDLE; | |
172 #else | |
173 typedef UINT HANDLE; | |
174 #endif | |
175 | |
176 | |
177 typedef HANDLE *LPHANDLE; | |
178 | |
179 /* Integer types. These are the same for emulator and library. */ | |
180 typedef UINT WPARAM; | |
181 typedef LONG LPARAM; | |
182 typedef LONG HRESULT; | |
183 typedef LONG LRESULT; | |
184 typedef WORD ATOM; | |
185 typedef WORD CATCHBUF[9]; | |
186 typedef WORD *LPCATCHBUF; | |
187 typedef HANDLE HHOOK; | |
188 typedef HANDLE HMONITOR; | |
189 typedef DWORD LCID; | |
190 typedef WORD LANGID; | |
191 typedef DWORD LCTYPE; | |
192 typedef float FLOAT; | |
193 | |
194 /* Pointers types. These are the same for emulator and library. */ | |
195 /* winnt types */ | |
196 typedef VOID *PVOID; | |
197 typedef const void *PCVOID; | |
198 typedef CHAR *PCHAR; | |
199 typedef UCHAR *PUCHAR; | |
200 typedef BYTE *PBYTE; | |
201 typedef WORD *PWORD; | |
202 typedef USHORT *PUSHORT; | |
203 typedef SHORT *PSHORT; | |
204 typedef ULONG *PULONG; | |
205 typedef LONG *PLONG; | |
206 typedef DWORD *PDWORD; | |
207 /* common win32 types */ | |
208 typedef CHAR *LPSTR; | |
209 typedef CHAR *PSTR; | |
210 typedef const CHAR *LPCSTR; | |
211 typedef const CHAR *PCSTR; | |
212 typedef WCHAR *LPWSTR; | |
213 typedef WCHAR *PWSTR; | |
214 typedef const WCHAR *LPCWSTR; | |
215 typedef const WCHAR *PCWSTR; | |
216 typedef BYTE *LPBYTE; | |
217 typedef WORD *LPWORD; | |
218 typedef DWORD *LPDWORD; | |
219 typedef LONG *LPLONG; | |
220 typedef VOID *LPVOID; | |
221 typedef const VOID *LPCVOID; | |
222 typedef INT *PINT; | |
223 typedef INT *LPINT; | |
224 typedef UINT *PUINT; | |
225 typedef UINT *LPUINT; | |
226 typedef FLOAT *PFLOAT; | |
227 typedef FLOAT *LPFLOAT; | |
228 typedef WIN_BOOL *PWIN_BOOL; | |
229 typedef WIN_BOOL *LPWIN_BOOL; | |
230 | |
231 /* Special case: a segmented pointer is just a pointer in the user's code. */ | |
232 | |
233 typedef DWORD SEGPTR; | |
234 | |
235 /* Handle types that exist both in Win16 and Win32. */ | |
236 | |
237 #ifdef STRICT | |
238 #define DECLARE_HANDLE(a) \ | |
239 typedef struct a##__ { int unused; } *a; \ | |
240 typedef a *P##a; \ | |
241 typedef a *LP##a | |
242 #else /*STRICT*/ | |
243 #define DECLARE_HANDLE(a) \ | |
244 typedef HANDLE a; \ | |
245 typedef a *P##a; \ | |
246 typedef a *LP##a | |
247 #endif /*STRICT*/ | |
248 | |
249 DECLARE_HANDLE(HACMDRIVERID); | |
250 DECLARE_HANDLE(HACMDRIVER); | |
251 DECLARE_HANDLE(HACMOBJ); | |
252 DECLARE_HANDLE(HACMSTREAM); | |
253 DECLARE_HANDLE(HMETAFILEPICT); | |
254 | |
255 DECLARE_HANDLE(HACCEL); | |
256 DECLARE_HANDLE(HBITMAP); | |
257 DECLARE_HANDLE(HBRUSH); | |
258 DECLARE_HANDLE(HCOLORSPACE); | |
259 DECLARE_HANDLE(HCURSOR); | |
260 DECLARE_HANDLE(HDC); | |
261 DECLARE_HANDLE(HDROP); | |
262 DECLARE_HANDLE(HDRVR); | |
263 DECLARE_HANDLE(HDWP); | |
264 DECLARE_HANDLE(HENHMETAFILE); | |
265 DECLARE_HANDLE(HFILE); | |
266 DECLARE_HANDLE(HFONT); | |
267 DECLARE_HANDLE(HICON); | |
268 DECLARE_HANDLE(HINSTANCE); | |
269 DECLARE_HANDLE(HKEY); | |
270 DECLARE_HANDLE(HMENU); | |
271 DECLARE_HANDLE(HMETAFILE); | |
272 DECLARE_HANDLE(HMIDI); | |
273 DECLARE_HANDLE(HMIDIIN); | |
274 DECLARE_HANDLE(HMIDIOUT); | |
275 DECLARE_HANDLE(HMIDISTRM); | |
276 DECLARE_HANDLE(HMIXER); | |
277 DECLARE_HANDLE(HMIXEROBJ); | |
278 DECLARE_HANDLE(HMMIO); | |
279 DECLARE_HANDLE(HPALETTE); | |
280 DECLARE_HANDLE(HPEN); | |
281 DECLARE_HANDLE(HQUEUE); | |
282 DECLARE_HANDLE(HRGN); | |
283 DECLARE_HANDLE(HRSRC); | |
284 DECLARE_HANDLE(HTASK); | |
285 DECLARE_HANDLE(HWAVE); | |
286 DECLARE_HANDLE(HWAVEIN); | |
287 DECLARE_HANDLE(HWAVEOUT); | |
288 DECLARE_HANDLE(HWINSTA); | |
289 DECLARE_HANDLE(HDESK); | |
290 DECLARE_HANDLE(HWND); | |
291 DECLARE_HANDLE(HKL); | |
292 DECLARE_HANDLE(HIC); | |
293 DECLARE_HANDLE(HRASCONN); | |
294 | |
295 /* Handle types that must remain interchangeable even with strict on */ | |
296 | |
297 typedef HINSTANCE HMODULE; | |
298 typedef HANDLE HGDIOBJ; | |
299 typedef HANDLE HGLOBAL; | |
300 typedef HANDLE HLOCAL; | |
301 typedef HANDLE GLOBALHANDLE; | |
302 typedef HANDLE LOCALHANDLE; | |
303 | |
304 /* Callback function pointers types */ | |
305 //WIN_BOOL CALLBACK DATEFMT_ENUMPROCA(LPSTR); | |
306 | |
307 typedef WIN_BOOL CALLBACK (* DATEFMT_ENUMPROCA)(LPSTR); | |
308 typedef WIN_BOOL CALLBACK (* DATEFMT_ENUMPROCW)(LPWSTR); | |
309 DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC) | |
310 typedef WIN_BOOL CALLBACK (*DLGPROC)(HWND,UINT,WPARAM,LPARAM); | |
311 typedef LRESULT CALLBACK (*DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM); | |
312 typedef INT CALLBACK (*EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT); | |
313 typedef INT CALLBACK (*EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT); | |
314 DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC) | |
315 typedef LRESULT CALLBACK (*FARPROC)(); | |
316 typedef INT CALLBACK (*PROC)(); | |
317 typedef WIN_BOOL CALLBACK (*GRAYSTRINGPROC)(HDC,LPARAM,INT); | |
318 typedef LRESULT CALLBACK (*HOOKPROC)(INT,WPARAM,LPARAM); | |
319 typedef WIN_BOOL CALLBACK (*PROPENUMPROCA)(HWND,LPCSTR,HANDLE); | |
320 typedef WIN_BOOL CALLBACK (*PROPENUMPROCW)(HWND,LPCWSTR,HANDLE); | |
321 DECL_WINELIB_TYPE_AW(PROPENUMPROC) | |
322 typedef WIN_BOOL CALLBACK (*PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM); | |
323 typedef WIN_BOOL CALLBACK (*PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM); | |
324 DECL_WINELIB_TYPE_AW(PROPENUMPROCEX) | |
325 typedef WIN_BOOL CALLBACK (* TIMEFMT_ENUMPROCA)(LPSTR); | |
326 typedef WIN_BOOL CALLBACK (* TIMEFMT_ENUMPROCW)(LPWSTR); | |
327 DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC) | |
328 typedef VOID CALLBACK (*TIMERPROC)(HWND,UINT,UINT,DWORD); | |
329 typedef WIN_BOOL CALLBACK (*WNDENUMPROC)(HWND,LPARAM); | |
330 typedef LRESULT CALLBACK (*WNDPROC)(HWND,UINT,WPARAM,LPARAM); | |
331 | |
332 /*---------------------------------------------------------------------------- | |
333 ** FIXME: Better isolate Wine's reliance on the xxx16 type definitions. | |
334 ** For now, we just isolate them to make the situation clear. | |
335 **--------------------------------------------------------------------------*/ | |
336 /* | |
337 * Basic type definitions for 16 bit variations on Windows types. | |
338 * These types are provided mostly to insure compatibility with | |
339 * 16 bit windows code. | |
340 */ | |
341 | |
24422
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
342 #ifndef WINE_WINDEF16_H |
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
343 #define WINE_WINDEF16_H |
1 | 344 |
345 #include "windef.h" | |
346 | |
347 /* Standard data types */ | |
348 | |
349 typedef short INT16; | |
350 typedef unsigned short UINT16; | |
351 typedef unsigned short WIN_BOOL16; | |
352 | |
353 typedef UINT16 HANDLE16; | |
354 typedef HANDLE16 *LPHANDLE16; | |
355 | |
356 typedef UINT16 WPARAM16; | |
357 typedef INT16 *LPINT16; | |
358 typedef UINT16 *LPUINT16; | |
359 | |
360 #define DECLARE_HANDLE16(a) \ | |
361 typedef HANDLE16 a##16; \ | |
362 typedef a##16 *P##a##16; \ | |
363 typedef a##16 *NP##a##16; \ | |
364 typedef a##16 *LP##a##16 | |
365 | |
366 DECLARE_HANDLE16(HACMDRIVERID); | |
367 DECLARE_HANDLE16(HACMDRIVER); | |
368 DECLARE_HANDLE16(HACMOBJ); | |
369 DECLARE_HANDLE16(HACMSTREAM); | |
370 DECLARE_HANDLE16(HMETAFILEPICT); | |
371 | |
372 DECLARE_HANDLE16(HACCEL); | |
373 DECLARE_HANDLE16(HBITMAP); | |
374 DECLARE_HANDLE16(HBRUSH); | |
375 DECLARE_HANDLE16(HCOLORSPACE); | |
376 DECLARE_HANDLE16(HCURSOR); | |
377 DECLARE_HANDLE16(HDC); | |
378 DECLARE_HANDLE16(HDROP); | |
379 DECLARE_HANDLE16(HDRVR); | |
380 DECLARE_HANDLE16(HDWP); | |
381 DECLARE_HANDLE16(HENHMETAFILE); | |
382 DECLARE_HANDLE16(HFILE); | |
383 DECLARE_HANDLE16(HFONT); | |
384 DECLARE_HANDLE16(HICON); | |
385 DECLARE_HANDLE16(HINSTANCE); | |
386 DECLARE_HANDLE16(HKEY); | |
387 DECLARE_HANDLE16(HMENU); | |
388 DECLARE_HANDLE16(HMETAFILE); | |
389 DECLARE_HANDLE16(HMIDI); | |
390 DECLARE_HANDLE16(HMIDIIN); | |
391 DECLARE_HANDLE16(HMIDIOUT); | |
392 DECLARE_HANDLE16(HMIDISTRM); | |
393 DECLARE_HANDLE16(HMIXER); | |
394 DECLARE_HANDLE16(HMIXEROBJ); | |
395 DECLARE_HANDLE16(HMMIO); | |
396 DECLARE_HANDLE16(HPALETTE); | |
397 DECLARE_HANDLE16(HPEN); | |
398 DECLARE_HANDLE16(HQUEUE); | |
399 DECLARE_HANDLE16(HRGN); | |
400 DECLARE_HANDLE16(HRSRC); | |
401 DECLARE_HANDLE16(HTASK); | |
402 DECLARE_HANDLE16(HWAVE); | |
403 DECLARE_HANDLE16(HWAVEIN); | |
404 DECLARE_HANDLE16(HWAVEOUT); | |
405 DECLARE_HANDLE16(HWINSTA); | |
406 DECLARE_HANDLE16(HDESK); | |
407 DECLARE_HANDLE16(HWND); | |
408 DECLARE_HANDLE16(HKL); | |
409 DECLARE_HANDLE16(HIC); | |
410 DECLARE_HANDLE16(HRASCONN); | |
411 #undef DECLARE_HANDLE16 | |
412 | |
413 typedef HINSTANCE16 HMODULE16; | |
414 typedef HANDLE16 HGDIOBJ16; | |
415 typedef HANDLE16 HGLOBAL16; | |
416 typedef HANDLE16 HLOCAL16; | |
417 | |
418 /* The SIZE structure */ | |
419 typedef struct | |
420 { | |
421 INT16 cx; | |
422 INT16 cy; | |
423 } SIZE16, *PSIZE16, *LPSIZE16; | |
424 | |
425 /* The POINT structure */ | |
426 | |
427 typedef struct | |
428 { | |
429 INT16 x; | |
430 INT16 y; | |
431 } POINT16, *PPOINT16, *LPPOINT16; | |
432 | |
433 /* The RECT structure */ | |
434 | |
435 typedef struct | |
436 { | |
437 INT16 left; | |
438 INT16 top; | |
439 INT16 right; | |
440 INT16 bottom; | |
441 } RECT16, *LPRECT16; | |
442 | |
443 /* Callback function pointers types */ | |
444 | |
445 typedef LRESULT CALLBACK (*DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM); | |
446 typedef WIN_BOOL16 CALLBACK (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM); | |
447 typedef INT16 CALLBACK (*EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16); | |
448 typedef LRESULT CALLBACK (*FARPROC16)(); | |
449 typedef INT16 CALLBACK (*PROC16)(); | |
450 typedef WIN_BOOL16 CALLBACK (*GRAYSTRINGPROC16)(HDC16,LPARAM,INT16); | |
451 typedef LRESULT CALLBACK (*HOOKPROC16)(INT16,WPARAM16,LPARAM); | |
452 typedef WIN_BOOL16 CALLBACK (*PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16); | |
453 typedef VOID CALLBACK (*TIMERPROC16)(HWND16,UINT16,UINT16,DWORD); | |
454 typedef LRESULT CALLBACK (*WNDENUMPROC16)(HWND16,LPARAM); | |
455 typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); | |
456 | |
24422
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
457 #endif /* WINE_WINDEF16_H */ |
1 | 458 |
459 /* Define some empty macros for compatibility with Windows code. */ | |
460 | |
461 /* Macro for structure packing. */ | |
462 | |
463 #ifdef __GNUC__ | |
464 #ifndef _EGCS_ | |
465 #define WINE_PACKED __attribute__((packed)) | |
466 #define WINE_UNUSED __attribute__((unused)) | |
467 #define WINE_NORETURN __attribute__((noreturn)) | |
468 #endif | |
469 #else | |
470 #define WINE_PACKED /* nothing */ | |
471 #define WINE_UNUSED /* nothing */ | |
472 #define WINE_NORETURN /* nothing */ | |
473 #endif | |
474 | |
475 /* Macros to split words and longs. */ | |
476 | |
477 #define LOBYTE(w) ((BYTE)(WORD)(w)) | |
478 #define HIBYTE(w) ((BYTE)((WORD)(w) >> 8)) | |
479 | |
480 #define LOWORD(l) ((WORD)(DWORD)(l)) | |
481 #define HIWORD(l) ((WORD)((DWORD)(l) >> 16)) | |
482 | |
483 #define SLOWORD(l) ((INT16)(LONG)(l)) | |
484 #define SHIWORD(l) ((INT16)((LONG)(l) >> 16)) | |
485 | |
486 #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8)) | |
487 #define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16))) | |
488 #define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high)) | |
489 #define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high)) | |
490 #define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high)) | |
491 #define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0)) | |
492 | |
493 #define SELECTOROF(ptr) (HIWORD(ptr)) | |
494 #define OFFSETOF(ptr) (LOWORD(ptr)) | |
495 | |
496 /* macros to set parts of a DWORD (not in the Windows API) */ | |
497 #define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val)) | |
498 #define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val)) | |
499 #define SET_HIBYTE(dw,val) ((dw) = ((dw) & 0xffff00ff) | (LOWORD(val) & 0xff00)) | |
500 #define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val))) | |
501 | |
502 /* Macros to access unaligned or wrong-endian WORDs and DWORDs. */ | |
503 /* Note: These macros are semantically broken, at least for wrc. wrc | |
504 spits out data in the platform's current binary format, *not* in | |
505 little-endian format. These macros are used throughout the resource | |
506 code to load and store data to the resources. Since it is unlikely | |
507 that we'll ever be dealing with little-endian resource data, the | |
508 byte-swapping nature of these macros has been disabled. Rather than | |
509 remove the use of these macros from the resource loading code, the | |
510 macros have simply been disabled. In the future, someone may want | |
511 to reactivate these macros for other purposes. In that case, the | |
512 resource code will have to be modified to use different macros. */ | |
513 | |
514 #if 1 | |
515 #define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w)) | |
516 #define GET_WORD(ptr) (*(WORD *)(ptr)) | |
517 #define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw)) | |
518 #define GET_DWORD(ptr) (*(DWORD *)(ptr)) | |
519 #else | |
520 #define PUT_WORD(ptr,w) (*(BYTE *)(ptr) = LOBYTE(w), \ | |
521 *((BYTE *)(ptr) + 1) = HIBYTE(w)) | |
522 #define GET_WORD(ptr) ((WORD)(*(BYTE *)(ptr) | \ | |
523 (WORD)(*((BYTE *)(ptr)+1) << 8))) | |
524 #define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \ | |
525 PUT_WORD((WORD *)(ptr)+1,HIWORD(dw))) | |
526 #define GET_DWORD(ptr) ((DWORD)(GET_WORD(ptr) | \ | |
527 ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16))) | |
528 #endif /* 1 */ | |
529 | |
530 /* min and max macros */ | |
531 #define __max(a,b) (((a) > (b)) ? (a) : (b)) | |
532 #define __min(a,b) (((a) < (b)) ? (a) : (b)) | |
533 #ifndef max | |
534 #define max(a,b) (((a) > (b)) ? (a) : (b)) | |
535 #endif | |
536 #ifndef min | |
537 #define min(a,b) (((a) < (b)) ? (a) : (b)) | |
538 #endif | |
539 | |
9978 | 540 #ifndef _MAX_PATH |
1 | 541 #define _MAX_PATH 260 |
9978 | 542 #endif |
543 #ifndef MAX_PATH | |
1 | 544 #define MAX_PATH 260 |
9978 | 545 #endif |
546 #ifndef _MAX_DRIVE | |
1 | 547 #define _MAX_DRIVE 3 |
9978 | 548 #endif |
549 #ifndef _MAX_DIR | |
1 | 550 #define _MAX_DIR 256 |
9978 | 551 #endif |
552 #ifndef _MAX_FNAME | |
1 | 553 #define _MAX_FNAME 255 |
9978 | 554 #endif |
555 #ifndef _MAX_EXT | |
1 | 556 #define _MAX_EXT 256 |
9978 | 557 #endif |
1 | 558 |
559 #define HFILE_ERROR16 ((HFILE16)-1) | |
560 #define HFILE_ERROR ((HFILE)-1) | |
561 | |
562 /* The SIZE structure */ | |
563 typedef struct tagSIZE | |
564 { | |
565 INT cx; | |
566 INT cy; | |
567 } SIZE, *PSIZE, *LPSIZE; | |
568 | |
569 | |
570 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL; | |
571 | |
572 #define CONV_SIZE16TO32(s16,s32) \ | |
573 ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy) | |
574 #define CONV_SIZE32TO16(s32,s16) \ | |
575 ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy) | |
576 | |
577 /* The POINT structure */ | |
578 typedef struct tagPOINT | |
579 { | |
580 LONG x; | |
581 LONG y; | |
582 } POINT, *PPOINT, *LPPOINT; | |
583 | |
584 typedef struct _POINTL | |
585 { | |
586 LONG x; | |
587 LONG y; | |
588 } POINTL; | |
589 | |
590 #define CONV_POINT16TO32(p16,p32) \ | |
591 ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y) | |
592 #define CONV_POINT32TO16(p32,p16) \ | |
593 ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y) | |
594 | |
595 #define MAKEPOINT16(l) (*((POINT16 *)&(l))) | |
596 | |
597 /* The POINTS structure */ | |
598 | |
599 typedef struct tagPOINTS | |
600 { | |
601 SHORT x; | |
602 SHORT y; | |
603 } POINTS, *PPOINTS, *LPPOINTS; | |
604 | |
605 | |
606 #define MAKEPOINTS(l) (*((POINTS *)&(l))) | |
607 | |
608 | |
609 /* The RECT structure */ | |
610 typedef struct tagRECT | |
611 { | |
612 short left; | |
613 short top; | |
614 short right; | |
615 short bottom; | |
616 } RECT, *PRECT, *LPRECT; | |
617 typedef const RECT *LPCRECT; | |
618 | |
619 | |
620 typedef struct tagRECTL | |
621 { | |
622 LONG left; | |
623 LONG top; | |
624 LONG right; | |
625 LONG bottom; | |
626 } RECTL, *PRECTL, *LPRECTL; | |
627 | |
628 typedef const RECTL *LPCRECTL; | |
629 | |
630 #define CONV_RECT16TO32(r16,r32) \ | |
631 ((r32)->left = (INT)(r16)->left, (r32)->top = (INT)(r16)->top, \ | |
632 (r32)->right = (INT)(r16)->right, (r32)->bottom = (INT)(r16)->bottom) | |
633 #define CONV_RECT32TO16(r32,r16) \ | |
634 ((r16)->left = (INT16)(r32)->left, (r16)->top = (INT16)(r32)->top, \ | |
635 (r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom) | |
636 | |
637 #ifdef __cplusplus | |
638 } | |
639 #endif | |
640 | |
24422
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
641 #endif /* WINE_WINDEF_H */ |