Of course, I forgot to commit the new file in revision 22049...
[reactos.git] / reactos / include / basetyps.h
1 #ifndef _BASETYPS_H
2 #define _BASETYPS_H
3 #if __GNUC__ >=3
4 #pragma GCC system_header
5 #endif
6
7 #ifndef __OBJC__
8 # ifdef __cplusplus
9 # define EXTERN_C extern "C"
10 # else
11 # define EXTERN_C extern
12 # endif /* __cplusplus */
13 # ifndef _MSC_VER
14 # ifndef __int64
15 # define __int64 long long
16 # endif
17 # ifndef __int32
18 # define __int32 long
19 # endif
20 # ifndef __int16
21 # define __int16 int
22 # endif
23 # ifndef __int8
24 # define __int8 char
25 # endif
26 # endif
27 # ifndef __small
28 # define __small char
29 # endif
30 # ifndef __hyper
31 # define __hyper __int64
32 # endif
33 # define STDMETHODCALLTYPE __stdcall
34 # define STDMETHODVCALLTYPE __cdecl
35 # define STDAPICALLTYPE __stdcall
36 # define STDAPIVCALLTYPE __cdecl
37 # define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
38 # define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
39 # define STDMETHODIMP HRESULT STDMETHODCALLTYPE
40 # define STDMETHODIMP_(t) t STDMETHODCALLTYPE
41 # define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
42 # define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
43 # define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
44 # define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
45 # define interface struct
46 # if defined(__cplusplus) && !defined(CINTERFACE)
47 # define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
48 # define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
49 # define PURE =0
50 # define THIS_
51 # define THIS void
52 /*
53 __attribute__((com_interface)) is obsolete in __GNUC__ >= 3
54 g++ vtables are now COM-compatible by default
55 */
56 # if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE)
57 # define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
58 # define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
59 # else
60 # define DECLARE_INTERFACE(i) interface i
61 # define DECLARE_INTERFACE_(i,b) interface i : public b
62 # endif
63 # else
64 # define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
65 # define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
66 # define PURE
67 # define THIS_ INTERFACE *,
68 # define THIS INTERFACE *
69 # ifndef CONST_VTABLE
70 # define CONST_VTABLE
71 # endif
72 # define DECLARE_INTERFACE(i) \
73 typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
74 typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
75 CONST_VTABLE struct i##Vtbl
76 # define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
77 # endif
78 # define BEGIN_INTERFACE
79 # define END_INTERFACE
80
81 # define FWD_DECL(i) typedef interface i i
82 # if defined(__cplusplus) && !defined(CINTERFACE)
83 # define IENUM_THIS(T)
84 # define IENUM_THIS_(T)
85 # else
86 # define IENUM_THIS(T) T*
87 # define IENUM_THIS_(T) T*,
88 # endif
89 # define DECLARE_ENUMERATOR_(I,T) \
90 DECLARE_INTERFACE_(I,IUnknown) \
91 { \
92 STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
93 STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
94 STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
95 STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
96 STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
97 STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
98 STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
99 }
100 # define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
101
102 #endif /* __OBJC__ */
103
104 #ifdef _GUID_DEFINED
105 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
106 #endif
107
108 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in winnt.h */
109 #define GUID_DEFINED
110 typedef struct _GUID
111 {
112 unsigned long Data1;
113 unsigned short Data2;
114 unsigned short Data3;
115 unsigned char Data4[8];
116 } GUID,*REFGUID,*LPGUID;
117 #endif /* GUID_DEFINED */
118 #ifndef LPCGUID_DEFINED
119 #define LPCGUID_DEFINED
120 typedef const GUID *LPCGUID;
121 #endif
122 #ifndef UUID_DEFINED
123 #define UUID_DEFINED
124 typedef GUID UUID;
125 #endif /* UUID_DEFINED */
126 typedef GUID IID;
127 typedef GUID CLSID;
128 typedef CLSID *LPCLSID;
129 typedef IID *LPIID;
130 typedef IID *REFIID;
131 typedef CLSID *REFCLSID;
132 typedef GUID FMTID;
133 typedef FMTID *REFFMTID;
134 typedef unsigned long error_status_t;
135 #define uuid_t UUID
136 typedef unsigned long PROPID;
137
138 #ifndef _REFGUID_DEFINED
139 #if defined (__cplusplus) && !defined (CINTERFACE)
140 #define REFGUID const GUID&
141 #define REFIID const IID&
142 #define REFCLSID const CLSID&
143 #else
144 #define REFGUID const GUID* const
145 #define REFIID const IID* const
146 #define REFCLSID const CLSID* const
147 #endif
148 #define _REFGUID_DEFINED
149 #define _REFIID_DEFINED
150 #define _REFCLSID_DEFINED
151 #endif
152 #ifndef GUID_SECTION
153 #define GUID_SECTION ".text"
154 #endif
155 #ifdef __GNUC__
156 #define GUID_SECT __attribute__ ((section (GUID_SECTION)))
157 #else
158 #define GUID_SECT
159 #endif
160 #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
161 #define GUID_EXT EXTERN_C
162 #else
163 #define GUID_EXT
164 #endif
165 #ifdef INITGUID
166 #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
167 #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
168 #else
169 #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
170 #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
171 #endif
172 #endif