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