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 */
45 #if defined(__cplusplus) && !defined(_MSC_VER)
48 template<typename T
> const GUID
&__wine_uuidof();
51 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
53 template<> inline const GUID &__wine_uuidof<type>() { \
54 static const IID __uuid_inst = {l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \
57 template<> inline const GUID &__wine_uuidof<type*>() { \
58 return __wine_uuidof<type>(); \
62 #define __uuidof(type) __wine_uuidof<typeof(type)>()
66 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
76 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
77 EXTERN_C const GUID name DECLSPEC_HIDDEN; \
78 EXTERN_C const GUID name = \
79 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
81 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
82 const GUID name DECLSPEC_HIDDEN; \
84 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
87 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
88 EXTERN_C const GUID name DECLSPEC_HIDDEN
91 #define DEFINE_OLEGUID(name, l, w1, w2) \
92 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
97 #ifndef __LPGUID_DEFINED__
98 #define __LPGUID_DEFINED__
102 #ifndef __LPCGUID_DEFINED__
103 #define __LPCGUID_DEFINED__
104 typedef const GUID
*LPCGUID
;
107 #ifndef __IID_DEFINED__
108 #define __IID_DEFINED__
110 typedef GUID IID
,*LPIID
;
111 typedef GUID CLSID
,*LPCLSID
;
112 typedef GUID FMTID
,*LPFMTID
;
113 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
114 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
115 #define IsEqualFMTID(rfmtid1, rfmtid2) IsEqualGUID(rfmtid1, rfmtid2)
116 #define IID_NULL GUID_NULL
117 #define CLSID_NULL GUID_NULL
118 #define FMTID_NULL GUID_NULL
123 #define __MIDL_CONST const
126 #endif /* ndef __IID_DEFINED__ */
129 #define REFGUID const GUID &
130 #define REFCLSID const CLSID &
131 #define REFIID const IID &
132 #define REFFMTID const FMTID &
133 #else /* !defined(__cplusplus) */
134 #define REFGUID const GUID* __MIDL_CONST
135 #define REFCLSID const CLSID* __MIDL_CONST
136 #define REFIID const IID* __MIDL_CONST
137 #define REFFMTID const FMTID* __MIDL_CONST
138 #endif /* !defined(__cplusplus) */
140 #if defined(__cplusplus) && !defined(CINTERFACE)
141 #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
142 inline int InlineIsEqualGUID(REFGUID rguid1
, REFGUID rguid2
)
144 return (((ULONG
*)&rguid1
)[0] == ((ULONG
*)&rguid2
)[0] &&
145 ((ULONG
*)&rguid1
)[1] == ((ULONG
*)&rguid2
)[1] &&
146 ((ULONG
*)&rguid1
)[2] == ((ULONG
*)&rguid2
)[2] &&
147 ((ULONG
*)&rguid1
)[3] == ((ULONG
*)&rguid2
)[3]);
149 #else /* defined(__cplusplus) && !defined(CINTERFACE) */
150 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
151 #define InlineIsEqualGUID(rguid1, rguid2) \
152 (((ULONG *)rguid1)[0] == ((ULONG *)rguid2)[0] && \
153 ((ULONG *)rguid1)[1] == ((ULONG *)rguid2)[1] && \
154 ((ULONG *)rguid1)[2] == ((ULONG *)rguid2)[2] && \
155 ((ULONG *)rguid1)[3] == ((ULONG *)rguid2)[3])
156 #endif /* defined(__cplusplus) && !defined(CINTERFACE) */
158 #if defined(__cplusplus) && !defined(CINTERFACE)
160 inline bool operator==(const GUID
& guidOne
, const GUID
& guidOther
)
162 return !memcmp(&guidOne
,&guidOther
,sizeof(GUID
));
164 inline bool operator!=(const GUID
& guidOne
, const GUID
& guidOther
)
166 return !(guidOne
== guidOther
);
170 extern const IID GUID_NULL
;
172 #endif /* _GUIDDEF_H_ */