3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 #pragma GCC system_header
31 # define EXTERN_C extern "C"
33 # define EXTERN_C extern
34 # endif /* __cplusplus */
36 # define __int64 long long
42 # define __int16 short
51 # define __hyper long long
53 # define STDMETHODCALLTYPE __stdcall
54 # define STDMETHODVCALLTYPE __cdecl
55 # define STDAPICALLTYPE __stdcall
56 # define STDAPIVCALLTYPE __cdecl
57 # define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
58 # define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
59 # define STDMETHODIMP HRESULT STDMETHODCALLTYPE
60 # define STDMETHODIMP_(t) t STDMETHODCALLTYPE
61 # define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
62 # define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
63 # define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
64 # define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
65 /* Newer MS compilers support the __interface keyword, but
66 that has a specific meaning that is enforced by the compiler.
67 For now, just get 'interface' out of the global namespace
69 # define _COM_interface struct
71 # define interface _COM_interface
73 # if defined(__cplusplus) && !defined(CINTERFACE)
74 # define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
75 # define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
79 # define DECLARE_INTERFACE(i) _COM_interface i
80 # define DECLARE_INTERFACE_(i,b) _COM_interface i : public b
82 # define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
83 # define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
85 # define THIS_ INTERFACE *,
86 # define THIS INTERFACE *
90 # define DECLARE_INTERFACE(i) \
91 typedef _COM_interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
92 typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
93 CONST_VTABLE struct i##Vtbl
94 # define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
96 # define BEGIN_INTERFACE
97 # define END_INTERFACE
99 # define FWD_DECL(i) typedef _COM_interface i i
100 # if defined(__cplusplus) && !defined(CINTERFACE)
101 # define IENUM_THIS(T)
102 # define IENUM_THIS_(T)
104 # define IENUM_THIS(T) T*
105 # define IENUM_THIS_(T) T*,
107 # define DECLARE_ENUMERATOR_(I,T) \
108 DECLARE_INTERFACE_(I,IUnknown) \
110 STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
111 STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
112 STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
113 STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
114 STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
115 STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
116 STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
118 # define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
120 #endif /* _OBJC_NO_COM_ */
123 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
126 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in winnt.h */
131 unsigned short Data2;
132 unsigned short Data3;
133 unsigned char Data4[8];
134 } GUID,*REFGUID,*LPGUID;
135 #endif /* GUID_DEFINED */
139 #endif /* UUID_DEFINED */
140 #ifndef __IID_DEFINED__
141 #define __IID_DEFINED__
143 #endif /* __IID_DEFINED__ */
145 typedef CLSID *LPCLSID;
148 typedef CLSID *REFCLSID;
150 typedef FMTID *REFFMTID;
151 typedef unsigned long error_status_t;
153 typedef unsigned long PROPID;
155 #ifndef _REFGUID_DEFINED
156 #if defined (__cplusplus) && !defined (CINTERFACE)
157 #define REFGUID const GUID&
158 #define REFIID const IID&
159 #define REFCLSID const CLSID&
160 #define REFFMTID const FMTID&
162 #define REFGUID const GUID* const
163 #define REFIID const IID* const
164 #define REFCLSID const CLSID* const
165 #define REFFMTID const FMTID* const
167 #define _REFGUID_DEFINED
168 #define _REFIID_DEFINED
169 #define _REFCLSID_DEFINED
170 #define _REFFMTID_DEFINED
172 /* FIXME: This shouldn't be needed.
174 #define GUID_SECTION ".text"
178 #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
179 #define GUID_EXT EXTERN_C
184 #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}}
185 #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
187 #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
188 #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)