4 #pragma GCC system_header
9 #define EXTERN_C extern "C"
11 #define EXTERN_C extern
12 #endif /* __cplusplus */
13 #define STDMETHODCALLTYPE __stdcall
14 #define STDMETHODVCALLTYPE __cdecl
15 #define STDAPICALLTYPE __stdcall
16 #define STDAPIVCALLTYPE __cdecl
17 #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
18 #define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
19 #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
20 #define STDMETHODIMP_(t) t STDMETHODCALLTYPE
21 #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
22 #define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
23 #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
24 #define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
25 #define interface struct
26 #if defined(__cplusplus) && !defined(CINTERFACE)
27 #define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
28 #define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
33 __attribute__((com_interface)) is obsolete in __GNUC__ >= 3
34 g++ vtables are now COM-compatible by default
36 #if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE)
37 #define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
38 #define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
40 #define DECLARE_INTERFACE(i) interface i
41 #define DECLARE_INTERFACE_(i,b) interface i : public b
44 #define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
45 #define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
47 #define THIS_ INTERFACE *,
48 #define THIS INTERFACE *
52 #define DECLARE_INTERFACE(i) \
53 typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
54 typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
55 CONST_VTABLE struct i##Vtbl
56 #define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
58 #define BEGIN_INTERFACE
61 #define FWD_DECL(i) typedef interface i i
62 #if defined(__cplusplus) && !defined(CINTERFACE)
64 #define IENUM_THIS_(T)
66 #define IENUM_THIS(T) T*
67 #define IENUM_THIS_(T) T*,
69 #define DECLARE_ENUMERATOR_(I,T) \
70 DECLARE_INTERFACE_(I,IUnknown) \
72 STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
73 STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
74 STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
75 STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
76 STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
77 STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
78 STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
80 #define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
84 #ifndef _GUID_DEFINED /* also defined in winnt.h */
91 unsigned char Data4
[8];
92 } GUID
,*REFGUID
,*LPGUID
;
93 #endif /* _GUID_DEFINED */
97 #endif /* UUID_DEFINED */
100 typedef CLSID
*LPCLSID
;
103 typedef CLSID
*REFCLSID
;
105 typedef FMTID
*REFFMTID
;
106 typedef unsigned long error_status_t
;
108 typedef unsigned long PROPID
;
110 #ifndef _REFGUID_DEFINED
111 #if defined (__cplusplus) && !defined (CINTERFACE)
112 #define REFGUID const GUID&
113 #define REFIID const IID&
114 #define REFCLSID const CLSID&
116 #define REFGUID const GUID* const
117 #define REFIID const IID* const
118 #define REFCLSID const CLSID* const
120 #define _REFGUID_DEFINED
121 #define _REFGIID_DEFINED
122 #define _REFCLSID_DEFINED
125 #define GUID_SECTION ".text"
128 #define GUID_SECT __attribute__ ((section (GUID_SECTION)))
132 #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
133 #define GUID_EXT EXTERN_C
138 #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}}
139 #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
141 #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
142 #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)