source: trunk/include/win/windef.h@ 9021

Last change on this file since 9021 was 9021, checked in by sandervl, 23 years ago

YD: fixed INT32 definition

File size: 20.0 KB
Line 
1/*
2 * Basic types definitions
3 *
4 * Copyright 1996 Alexandre Julliard
5 */
6
7#ifndef __WINE_WINDEF_H
8#define __WINE_WINDEF_H
9
10#ifdef __WINE__
11# include "config.h"
12# undef UNICODE
13#endif /* __WINE__ */
14
15#define WINVER 0x0500
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/* Misc. constants. */
22
23#ifdef FALSE
24#undef FALSE
25#endif
26#define FALSE 0
27
28#ifdef TRUE
29#undef TRUE
30#endif
31#define TRUE 1
32
33#ifdef NULL
34#undef NULL
35#endif
36#define NULL 0
37
38/* Macros to map Winelib names to the correct implementation name */
39/* depending on __WINE__ and UNICODE macros. */
40/* Note that Winelib is purely Win32. */
41
42#ifdef __WINE__
43#ifdef __WIN32OS2__
44# define WINELIB_NAME_AW(func) func
45#else
46# define WINELIB_NAME_AW(func) this_is_a_syntax_error this_is_a_syntax_error
47#endif
48#else /* __WINE__ */
49# ifdef UNICODE
50# define WINELIB_NAME_AW(func) func##W
51# else
52# define WINELIB_NAME_AW(func) func##A
53# endif /* UNICODE */
54#endif /* __WINE__ */
55
56#ifdef __WINE__
57# define DECL_WINELIB_TYPE_AW(type) /* nothing */
58#else /* __WINE__ */
59# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
60#endif /* __WINE__ */
61
62
63/* Calling conventions definitions */
64
65#ifndef __WIN32OS2__
66#ifdef __i386__
67# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
68# define __stdcall __attribute__((__stdcall__))
69# define __cdecl __attribute__((__cdecl__))
70# define __RESTORE_ES __asm__ __volatile__("pushl %ds\n\tpopl %es")
71# else
72# error You need gcc >= 2.7 to build Wine on a 386
73# endif /* __GNUC__ */
74#else /* __i386__ */
75# define __stdcall
76# define __cdecl
77# define __RESTORE_ES
78#endif /* __i386__ */
79#endif
80
81
82#include <odin.h>
83
84/* define needed macros as required */
85#ifndef CALLBACK
86 #define CALLBACK __stdcall
87#endif
88
89#ifndef WINAPI
90 #define WINAPI __stdcall
91#endif
92
93#ifndef APIPRIVATE
94 #define APIPRIVATE __stdcall
95#endif
96
97#ifndef PASCAL
98 #define PASCAL __stdcall
99#endif
100
101#ifndef pascal
102 #define pascal __stdcall
103#endif
104
105#ifndef _pascal
106 #define _pascal __stdcall
107#endif
108
109#ifndef _stdcall
110 #define _stdcall __stdcall
111#endif
112
113#ifndef _fastcall
114 #define _fastcall __stdcall
115#endif
116
117#ifndef __export
118 #define __export
119#endif
120
121#ifndef CDECL
122 #define CDECL __cdecl
123#endif
124
125#ifndef _CDECL
126 #define _CDECL __cdecl
127#endif
128
129#ifndef cdecl
130 #define cdecl __cdecl
131#endif
132
133#ifndef _cdecl
134 #define _cdecl __cdecl
135#endif
136
137#ifndef WINAPIV
138 #define WINAPIV __cdecl
139#endif
140
141#ifndef APIENTRY
142 #define APIENTRY WINAPI
143#endif
144
145#ifndef WIN32API
146 #define WIN32API WINAPI
147#endif
148
149
150#if (__IBMC__ < 400) && (__IBMCPP__ < 360)
151#ifndef __declspec
152 #define __declspec(x)
153#endif
154
155#ifndef dllimport
156 #define dllimport
157#endif
158
159#ifndef dllexport
160 #define dllexport
161#endif
162#endif // (__IBMC__ < 400) && (__IBMCPP__ < 360)
163
164#ifndef CONST
165 #define CONST const
166#endif
167
168/* Anonymous union/struct handling */
169
170#ifndef NONAMELESSSTRUCT
171#define DUMMYSTRUCTNAME
172#define DUMMYSTRUCTNAME1
173#define DUMMYSTRUCTNAME2
174#define DUMMYSTRUCTNAME3
175#define DUMMYSTRUCTNAME4
176#define DUMMYSTRUCTNAME5
177#else /* !defined(NONAMELESSSTRUCT) */
178#define DUMMYSTRUCTNAME s
179#define DUMMYSTRUCTNAME1 s1
180#define DUMMYSTRUCTNAME2 s2
181#define DUMMYSTRUCTNAME3 s3
182#define DUMMYSTRUCTNAME4 s4
183#define DUMMYSTRUCTNAME5 s5
184#endif /* !defined(NONAMELESSSTRUCT) */
185
186#ifndef NONAMELESSUNION
187#define DUMMYUNIONNAME
188#define DUMMYUNIONNAME1
189#define DUMMYUNIONNAME2
190#define DUMMYUNIONNAME3
191#define DUMMYUNIONNAME4
192#define DUMMYUNIONNAME5
193#define DUMMYUNIONNAME6
194#define DUMMYUNIONNAME7
195#define DUMMYUNIONNAME8
196#else /* !defined(NONAMELESSUNION) */
197#define DUMMYUNIONNAME u
198#define DUMMYUNIONNAME1 u1
199#define DUMMYUNIONNAME2 u2
200#define DUMMYUNIONNAME3 u3
201#define DUMMYUNIONNAME4 u4
202#define DUMMYUNIONNAME5 u5
203#define DUMMYUNIONNAME6 u6
204#define DUMMYUNIONNAME7 u7
205#define DUMMYUNIONNAME8 u8
206#endif /* !defined(NONAMELESSUNION) */
207
208
209/* Standard data types. These are the same for emulator and library. */
210
211typedef void VOID;
212typedef short INT16;
213typedef unsigned short UINT16;
214typedef int INT;
215typedef unsigned int UINT;
216typedef signed int INT32;
217typedef UINT * UINT_PTR;
218typedef unsigned short WORD;
219typedef unsigned long DWORD;
220typedef unsigned long ULONG;
221typedef unsigned char BYTE;
222typedef long LONG;
223typedef short SHORT;
224typedef unsigned short USHORT;
225typedef char CHAR;
226typedef unsigned char UCHAR;
227/* Some systems might have wchar_t, but we really need 16 bit characters */
228typedef unsigned short WCHAR;
229typedef unsigned short BOOL16;
230typedef unsigned long BOOL;
231typedef double DATE;
232typedef long LONG_PTR;
233typedef unsigned long ULONG_PTR;
234typedef double DOUBLE;
235#if (__IBMC__ < 360) && (__IBMCPP__ < 360)
236typedef double LONGLONG;
237typedef double ULONGLONG;
238typedef double ULONGULONG;
239typedef double DWORDLONG;
240#else
241#include <inttypes.h>
242typedef int64_t LONGLONG;
243typedef uint64_t ULONGLONG;
244typedef uint64_t ULONGULONG;
245typedef uint64_t DWORDLONG;
246#endif
247
248/* FIXME: Wine does not compile with strict on, therefore strict
249 * handles are presently only usable on machines where sizeof(UINT) ==
250 * sizeof(void*). HANDLEs are supposed to be void* but a large amount
251 * of WINE code operates on HANDLES as if they are UINTs. So to WINE
252 * they exist as UINTs but to the Winelib user who turns on strict,
253 * they exist as void*. If there is a size difference between UINT and
254 * void* then things get ugly. */
255#ifdef STRICT
256typedef UINT16 HANDLE16;
257typedef VOID* HANDLE;
258#else
259typedef UINT16 HANDLE16;
260typedef ULONG HANDLE;
261#endif
262
263typedef HANDLE16 *LPHANDLE16;
264typedef HANDLE *LPHANDLE;
265
266/* Integer types. These are the same for emulator and library. */
267typedef UINT16 WPARAM16;
268typedef UINT WPARAM;
269typedef LONG LPARAM;
270typedef LONG HRESULT;
271typedef LONG LRESULT;
272typedef WORD ATOM;
273typedef WORD CATCHBUF[9];
274typedef WORD *LPCATCHBUF;
275typedef DWORD REGSAM;
276typedef HANDLE HHOOK;
277typedef HANDLE HKEY;
278typedef HANDLE HMONITOR;
279typedef DWORD LCID;
280typedef WORD LANGID;
281typedef DWORD LCTYPE;
282typedef float FLOAT;
283#ifdef __WIN32OS2__
284#if (__IBMC__ < 400) && (__IBMCPP__ < 360) && !defined(__WATCOMC__)
285typedef double __int64;
286#endif
287#else
288typedef long long __int64;
289#endif
290
291/* Pointers types. These are the same for emulator and library. */
292/* winnt types */
293typedef VOID *PVOID;
294typedef const void *PCVOID;
295typedef CHAR *PCHAR;
296typedef UCHAR *PUCHAR;
297typedef BYTE *PBYTE;
298typedef ULONG *PULONG;
299typedef LONG *PLONG;
300typedef DWORD *PDWORD;
301/* common win32 types */
302#ifdef __WINE__
303typedef CHAR *LPTSTR;
304typedef const CHAR *LPCTSTR;
305#endif
306typedef CHAR *LPSTR;
307typedef CHAR *PSTR;
308typedef const CHAR *LPCSTR;
309typedef const CHAR *PCSTR;
310typedef WCHAR *LPWSTR;
311typedef WCHAR *PWSTR;
312typedef const WCHAR *LPCWSTR;
313typedef const WCHAR *PCWSTR;
314typedef BYTE *LPBYTE;
315typedef WORD *LPWORD;
316typedef DWORD *LPDWORD;
317typedef LONG *LPLONG;
318typedef VOID *LPVOID;
319typedef const VOID *LPCVOID;
320typedef INT16 *LPINT16;
321typedef UINT16 *LPUINT16;
322typedef INT *PINT;
323typedef INT *LPINT;
324typedef UINT *PUINT;
325typedef UINT *LPUINT;
326typedef HKEY *LPHKEY;
327typedef HKEY *PHKEY;
328typedef FLOAT *PFLOAT;
329typedef FLOAT *LPFLOAT;
330typedef BOOL *PBOOL;
331typedef BOOL *LPBOOL;
332
333/* Special case: a segmented pointer is just a pointer in the user's code. */
334
335#ifdef __WINE__
336typedef DWORD SEGPTR;
337#else
338typedef void* SEGPTR;
339#endif /* __WINE__ */
340
341/* Handle types that exist both in Win16 and Win32. */
342
343#ifdef STRICT
344#define DECLARE_HANDLE(a) \
345 typedef HANDLE16 a##16; \
346 typedef a##16 *P##a##16; \
347 typedef a##16 *NP##a##16; \
348 typedef a##16 *LP##a##16; \
349 typedef struct a##__ { int unused; } *a; \
350 typedef a *P##a; \
351 typedef a *LP##a
352#else /*STRICT*/
353#define DECLARE_HANDLE(a) \
354 typedef HANDLE16 a##16; \
355 typedef a##16 *P##a##16; \
356 typedef a##16 *NP##a##16; \
357 typedef a##16 *LP##a##16; \
358 typedef HANDLE a; \
359 typedef a *P##a; \
360 typedef a *LP##a
361#endif /*STRICT*/
362
363DECLARE_HANDLE(HACMDRIVERID);
364DECLARE_HANDLE(HACMDRIVER);
365DECLARE_HANDLE(HACMOBJ);
366DECLARE_HANDLE(HACMSTREAM);
367DECLARE_HANDLE(HMETAFILEPICT);
368
369DECLARE_HANDLE(HACCEL);
370DECLARE_HANDLE(HBITMAP);
371DECLARE_HANDLE(HBRUSH);
372DECLARE_HANDLE(HCOLORSPACE);
373DECLARE_HANDLE(HCURSOR);
374DECLARE_HANDLE(HDC);
375DECLARE_HANDLE(HGLRC); // OpenGL
376DECLARE_HANDLE(HDROP);
377DECLARE_HANDLE(HDRVR);
378DECLARE_HANDLE(HDWP);
379DECLARE_HANDLE(HENHMETAFILE);
380DECLARE_HANDLE(HFILE);
381DECLARE_HANDLE(HFONT);
382DECLARE_HANDLE(HICON);
383DECLARE_HANDLE(HINSTANCE);
384DECLARE_HANDLE(HMENU);
385DECLARE_HANDLE(HMETAFILE);
386DECLARE_HANDLE(HMIDI);
387DECLARE_HANDLE(HMIDIIN);
388DECLARE_HANDLE(HMIDIOUT);
389DECLARE_HANDLE(HMIDISTRM);
390DECLARE_HANDLE(HMIXER);
391DECLARE_HANDLE(HMIXEROBJ);
392DECLARE_HANDLE(HMMIO);
393DECLARE_HANDLE(HPALETTE);
394DECLARE_HANDLE(HPEN);
395DECLARE_HANDLE(HQUEUE);
396DECLARE_HANDLE(HRGN);
397DECLARE_HANDLE(HRSRC);
398DECLARE_HANDLE(HTASK);
399DECLARE_HANDLE(HWAVE);
400DECLARE_HANDLE(HWAVEIN);
401DECLARE_HANDLE(HWAVEOUT);
402DECLARE_HANDLE(HWINSTA);
403DECLARE_HANDLE(HDESK);
404DECLARE_HANDLE(HWND);
405DECLARE_HANDLE(HKL);
406DECLARE_HANDLE(HIC);
407DECLARE_HANDLE(HRASCONN);
408DECLARE_HANDLE(HPRINTER);
409#undef DECLARE_HANDLE
410
411/* Handle types that must remain interchangeable even with strict on */
412
413typedef HINSTANCE16 HMODULE16;
414typedef HINSTANCE HMODULE;
415typedef HANDLE16 HGDIOBJ16;
416typedef HANDLE16 HGLOBAL16;
417typedef HANDLE16 HLOCAL16;
418typedef HANDLE HGDIOBJ;
419typedef HANDLE HGLOBAL;
420typedef HANDLE HLOCAL;
421
422/* Callback function pointers types */
423
424#ifdef __IBMC__
425typedef BOOL16 (* CALLBACK DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
426typedef BOOL (* CALLBACK DLGPROC)(HWND,UINT,WPARAM,LPARAM);
427typedef LRESULT (* CALLBACK DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
428typedef LRESULT (* CALLBACK DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
429typedef INT16 (* CALLBACK EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
430typedef INT (* CALLBACK EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
431typedef INT (* CALLBACK EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
432DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
433typedef LRESULT (* CALLBACK FARPROC16)();
434typedef LRESULT (* CALLBACK FARPROC)();
435typedef INT16 (* CALLBACK PROC16)();
436typedef INT (* CALLBACK PROC)();
437typedef INT16 (* CALLBACK GOBJENUMPROC16)(SEGPTR,LPARAM);
438typedef INT (* CALLBACK GOBJENUMPROC)(LPVOID,LPARAM);
439typedef BOOL16 (* CALLBACK GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
440typedef BOOL (* CALLBACK GRAYSTRINGPROC)(HDC,LPARAM,INT);
441typedef LRESULT (* CALLBACK HOOKPROC16)(INT16,WPARAM16,LPARAM);
442typedef LRESULT (* CALLBACK HOOKPROC)(INT,WPARAM,LPARAM);
443typedef VOID (* CALLBACK LINEDDAPROC16)(INT16,INT16,LPARAM);
444typedef VOID (* CALLBACK LINEDDAPROC)(INT,INT,LPARAM);
445typedef BOOL16 (* CALLBACK PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
446typedef BOOL (* CALLBACK PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
447typedef BOOL (* CALLBACK PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
448DECL_WINELIB_TYPE_AW(PROPENUMPROC)
449typedef BOOL (* CALLBACK PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
450typedef BOOL (* CALLBACK PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
451DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
452typedef VOID (* CALLBACK TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
453typedef VOID (* CALLBACK TIMERPROC)(HWND,UINT,UINT,DWORD);
454typedef LRESULT (* CALLBACK WNDENUMPROC16)(HWND16,LPARAM);
455//typedef LRESULT (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
456typedef BOOL (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
457typedef LRESULT (* CALLBACK WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
458typedef LRESULT (* CALLBACK WNDPROC)(HWND,UINT,WPARAM,LPARAM);
459#else
460typedef BOOL16 ( CALLBACK * DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
461typedef BOOL ( CALLBACK * DLGPROC)(HWND,UINT,WPARAM,LPARAM);
462typedef LRESULT ( CALLBACK * DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
463typedef LRESULT ( CALLBACK * DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
464typedef INT16 ( CALLBACK * EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
465typedef INT ( CALLBACK * EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
466typedef INT ( CALLBACK * EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
467DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
468typedef LRESULT ( CALLBACK * FARPROC16)();
469typedef LRESULT ( CALLBACK * FARPROC)();
470typedef INT16 ( CALLBACK * PROC16)();
471typedef INT ( CALLBACK * PROC)();
472typedef INT16 ( CALLBACK * GOBJENUMPROC16)(SEGPTR,LPARAM);
473typedef INT ( CALLBACK * GOBJENUMPROC)(LPVOID,LPARAM);
474typedef BOOL16 ( CALLBACK * GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
475typedef BOOL ( CALLBACK * GRAYSTRINGPROC)(HDC,LPARAM,INT);
476typedef LRESULT ( CALLBACK * HOOKPROC16)(INT16,WPARAM16,LPARAM);
477typedef LRESULT ( CALLBACK * HOOKPROC)(INT,WPARAM,LPARAM);
478typedef VOID ( CALLBACK * LINEDDAPROC16)(INT16,INT16,LPARAM);
479typedef VOID ( CALLBACK * LINEDDAPROC)(INT,INT,LPARAM);
480typedef BOOL16 ( CALLBACK * PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
481typedef BOOL ( CALLBACK * PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
482typedef BOOL ( CALLBACK * PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
483DECL_WINELIB_TYPE_AW(PROPENUMPROC)
484typedef BOOL ( CALLBACK * PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
485typedef BOOL ( CALLBACK * PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
486DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
487typedef VOID ( CALLBACK * TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
488typedef VOID ( CALLBACK * TIMERPROC)(HWND,UINT,UINT,DWORD);
489typedef LRESULT ( CALLBACK * WNDENUMPROC16)(HWND16,LPARAM);
490typedef BOOL ( CALLBACK * WNDENUMPROC)(HWND,LPARAM);
491typedef LRESULT ( CALLBACK * WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
492typedef LRESULT ( CALLBACK * WNDPROC)(HWND,UINT,WPARAM,LPARAM);
493#endif
494
495/* TCHAR data types definitions for Winelib. */
496/* These types are _not_ defined for the emulator, because they */
497/* depend on the UNICODE macro that only exists in user's code. */
498
499#ifndef __WINE__
500# ifdef UNICODE
501typedef WCHAR TCHAR;
502typedef LPWSTR LPTSTR;
503typedef LPCWSTR LPCTSTR;
504#define __TEXT(string) L##string /*probably wrong */
505# else /* UNICODE */
506typedef CHAR TCHAR;
507typedef LPSTR LPTSTR;
508typedef LPCSTR LPCTSTR;
509#define __TEXT(string) string
510# endif /* UNICODE */
511#endif /* __WINE__ */
512#define TEXT(quote) __TEXT(quote)
513
514/* Data types specific to the library. These do _not_ exist in the emulator. */
515
516
517
518/* Define some empty macros for compatibility with Windows code. */
519
520#ifndef __WINE__
521#define NEAR
522#define FAR
523#define near
524#define far
525#define _near
526#define _far
527#define IN
528#define OUT
529#define OPTIONAL
530#endif /* __WINE__ */
531
532/* Macro for structure packing. */
533
534#ifdef __GNUC__
535#define WINE_PACKED __attribute__ ((packed))
536#define WINE_UNUSED __attribute__ ((unused))
537#else
538#define WINE_PACKED /* nothing */
539#define WINE_UNUSED /* nothing */
540#endif
541
542/* Macros to split words and longs. */
543
544#define LOBYTE(w) ((BYTE)(WORD)(w))
545#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
546
547#define LOWORD(l) ((WORD)(DWORD)(l))
548#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
549
550#define SLOWORD(l) ((INT16)(LONG)(l))
551#define SHIWORD(l) ((INT16)((LONG)(l) >> 16))
552
553#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
554#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
555#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
556#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high))
557#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high))
558#define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0))
559
560#define SELECTOROF(ptr) (HIWORD(ptr))
561#define OFFSETOF(ptr) (LOWORD(ptr))
562
563/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
564/* Note: These macros are semantically broken, at least for wrc. wrc
565 spits out data in the platform's current binary format, *not* in
566 little-endian format. These macros are used throughout the resource
567 code to load and store data to the resources. Since it is unlikely
568 that we'll ever be dealing with little-endian resource data, the
569 byte-swapping nature of these macros has been disabled. Rather than
570 remove the use of these macros from the resource loading code, the
571 macros have simply been disabled. In the future, someone may want
572 to reactivate these macros for other purposes. In that case, the
573 resource code will have to be modified to use different macros. */
574
575#if 1
576#define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w))
577#define GET_WORD(ptr) (*(WORD *)(ptr))
578#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
579#define GET_DWORD(ptr) (*(DWORD *)(ptr))
580#else
581#define PUT_WORD(ptr,w) (*(BYTE *)(ptr) = LOBYTE(w), \
582 *((BYTE *)(ptr) + 1) = HIBYTE(w))
583#define GET_WORD(ptr) ((WORD)(*(BYTE *)(ptr) | \
584 (WORD)(*((BYTE *)(ptr)+1) << 8)))
585#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
586 PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
587#define GET_DWORD(ptr) ((DWORD)(GET_WORD(ptr) | \
588 ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
589#endif /* 1 */
590
591/* MIN and MAX macros */
592
593#ifdef MAX
594#undef MAX
595#endif
596#define MAX(a,b) (((a) > (b)) ? (a) : (b))
597
598#ifdef MIN
599#undef MIN
600#endif
601#define MIN(a,b) (((a) < (b)) ? (a) : (b))
602
603#ifdef __max /* watcom stdlib.h defines this */
604#undef __max
605#endif
606#define __max(a,b) MAX(a,b)
607
608#ifdef __min /* watcom stdlib.h defines this */
609#undef __min
610#endif
611#define __min(a,b) MIN(a,b)
612#ifndef RC_INVOKED
613#include <stdlib.h>
614#endif
615
616#if !defined(__WATCOMC__) || !defined(_MAX_PATH)
617#define _MAX_PATH 260
618#endif
619#define MAX_PATH 260
620#define _MAX_DRIVE 3
621#if !defined(__WATCOMC__) || !defined(_MAX_DIR)
622#define _MAX_DIR 256
623#endif
624#if !defined(__WIN32OS2__) && !defined(_MAX_FNAME)
625#define _MAX_FNAME 255
626#endif
627#if !defined(__WATCOMC__) || !defined(_MAX_EXT)
628#define _MAX_EXT 256
629#endif
630
631#define HFILE_ERROR16 ((HFILE16)-1)
632#define HFILE_ERROR ((HFILE)-1)
633
634/* Winelib run-time flag */
635
636#ifdef __WINE__
637extern int __winelib;
638#endif /* __WINE__ */
639
640/* The SIZE structure */
641
642typedef struct
643{
644 INT16 cx;
645 INT16 cy;
646} SIZE16, *PSIZE16, *LPSIZE16;
647
648typedef struct tagSIZE
649{
650 INT cx;
651 INT cy;
652} SIZE, *PSIZE, *LPSIZE;
653
654
655typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
656
657#define CONV_SIZE16TO32(s16,s32) \
658 ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
659#define CONV_SIZE32TO16(s32,s16) \
660 ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
661
662/* The POINT structure */
663
664typedef struct
665{
666 INT16 x;
667 INT16 y;
668} POINT16, *PPOINT16, *LPPOINT16;
669
670typedef struct tagPOINT
671{
672 LONG x;
673 LONG y;
674} POINT, *PPOINT, *LPPOINT;
675
676typedef struct _POINTL
677{
678 LONG x;
679 LONG y;
680} POINTL;
681
682#define CONV_POINT16TO32(p16,p32) \
683 ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
684#define CONV_POINT32TO16(p32,p16) \
685 ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
686
687#define MAKEPOINT(l) (*((POINT *)&(l)))
688
689#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
690
691/* The POINTS structure */
692
693typedef struct tagPOINTS
694{
695 SHORT x;
696 SHORT y;
697} POINTS, *PPOINTS, *LPPOINTS;
698
699
700#define MAKEPOINTS(l) (*((POINTS *)&(l)))
701
702
703/* The RECT structure */
704
705typedef struct
706{
707 INT16 left;
708 INT16 top;
709 INT16 right;
710 INT16 bottom;
711} RECT16, *LPRECT16;
712
713typedef struct tagRECT
714{
715 INT left;
716 INT top;
717 INT right;
718 INT bottom;
719} RECT, *PRECT, *LPRECT;
720typedef const RECT *LPCRECT;
721
722
723typedef struct tagRECTL
724{
725 LONG left;
726 LONG top;
727 LONG right;
728 LONG bottom;
729} RECTL, *PRECTL, *LPRECTL;
730
731typedef const RECTL *LPCRECTL;
732
733/*
734 * 8.9.99 DJR DECIMAL support
735 */
736typedef struct tagDEC
737{
738 USHORT wReserved;
739 union
740 {
741 struct
742 {
743 BYTE scale;
744 BYTE sign;
745 } a;
746 USHORT signscale;
747 } b;
748 ULONG Hi32;
749 union
750 {
751 struct
752 {
753 ULONG Lo32;
754 ULONG Mid32;
755 } c;
756 ULONGLONG Lo64;
757 } d;
758} DECIMAL;
759
760#include <winbase.h>
761
762#ifdef __cplusplus
763}
764#endif
765
766#endif /* __WINE_WINDEF_H */
Note: See TracBrowser for help on using the repository browser.