2 * Copyright (C) 2000 Alexandre Julliard
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
40 unsigned char Data4
[ 8 ];
44 /* Macros for __uuidof emulation */
46 # if defined(__MINGW32__)
47 # define __WINE_UUID_ATTR __attribute__((selectany))
48 # elif defined(__GNUC__)
49 # define __WINE_UUID_ATTR __attribute__((visibility("hidden"),weak))
53 #ifdef __WINE_UUID_ATTR
56 template<typename T
> struct __wine_uuidof
;
58 template<typename T
> struct __wine_uuidof_type
{
59 typedef __wine_uuidof
<T
> inst
;
61 template<typename T
> struct __wine_uuidof_type
<T
*> {
62 typedef __wine_uuidof
<T
> inst
;
64 template<typename T
> struct __wine_uuidof_type
<T
* const> {
65 typedef __wine_uuidof
<T
> inst
;
69 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
71 template<> struct __wine_uuidof<type> { \
72 static const GUID uuid; \
74 __WINE_UUID_ATTR const GUID __wine_uuidof<type>::uuid = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}; \
77 #define __uuidof(type) __wine_uuidof_type<__typeof__(type)>::inst::uuid
79 #else /* __WINE_UUID_ATTR */
81 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
83 #endif /* __WINE_UUID_ATTR */
89 #ifndef DECLSPEC_HIDDEN
90 # if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__)
91 # define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
93 # define DECLSPEC_HIDDEN
99 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
100 EXTERN_C const GUID name DECLSPEC_HIDDEN; \
101 EXTERN_C const GUID name = \
102 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
104 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
105 const GUID name DECLSPEC_HIDDEN; \
107 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
110 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
111 EXTERN_C const GUID name DECLSPEC_HIDDEN
114 #define DEFINE_OLEGUID(name, l, w1, w2) \
115 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
120 #ifndef __LPGUID_DEFINED__
121 #define __LPGUID_DEFINED__
122 typedef GUID
*LPGUID
;
125 #ifndef __LPCGUID_DEFINED__
126 #define __LPCGUID_DEFINED__
127 typedef const GUID
*LPCGUID
;
130 #ifndef __IID_DEFINED__
131 #define __IID_DEFINED__
133 typedef GUID IID
,*LPIID
;
134 typedef GUID CLSID
,*LPCLSID
;
135 typedef GUID FMTID
,*LPFMTID
;
136 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
137 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
138 #define IsEqualFMTID(rfmtid1, rfmtid2) IsEqualGUID(rfmtid1, rfmtid2)
139 #define IID_NULL GUID_NULL
140 #define CLSID_NULL GUID_NULL
141 #define FMTID_NULL GUID_NULL
146 #define __MIDL_CONST const
149 #endif /* ndef __IID_DEFINED__ */
152 #define REFGUID const GUID &
153 #define REFCLSID const CLSID &
154 #define REFIID const IID &
155 #define REFFMTID const FMTID &
157 #define REFGUID const GUID* __MIDL_CONST
158 #define REFCLSID const CLSID* __MIDL_CONST
159 #define REFIID const IID* __MIDL_CONST
160 #define REFFMTID const FMTID* __MIDL_CONST
164 #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
165 inline int InlineIsEqualGUID(REFGUID rguid1
, REFGUID rguid2
)
167 return (((unsigned int *)&rguid1
)[0] == ((unsigned int *)&rguid2
)[0] &&
168 ((unsigned int *)&rguid1
)[1] == ((unsigned int *)&rguid2
)[1] &&
169 ((unsigned int *)&rguid1
)[2] == ((unsigned int *)&rguid2
)[2] &&
170 ((unsigned int *)&rguid1
)[3] == ((unsigned int *)&rguid2
)[3]);
173 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
174 #define InlineIsEqualGUID(rguid1, rguid2) \
175 (((unsigned int *)rguid1)[0] == ((unsigned int *)rguid2)[0] && \
176 ((unsigned int *)rguid1)[1] == ((unsigned int *)rguid2)[1] && \
177 ((unsigned int *)rguid1)[2] == ((unsigned int *)rguid2)[2] && \
178 ((unsigned int *)rguid1)[3] == ((unsigned int *)rguid2)[3])
183 inline bool operator==(const GUID
& guidOne
, const GUID
& guidOther
)
185 return !memcmp(&guidOne
,&guidOther
,sizeof(GUID
));
187 inline bool operator!=(const GUID
& guidOne
, const GUID
& guidOther
)
189 return !(guidOne
== guidOther
);
193 #endif /* _GUIDDEF_H_ */