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
30 unsigned char Data4[ 8 ];
33 /* Macros for __uuidof emulation */
34 #if defined(__cplusplus) && !defined(_MSC_VER)
37 template<typename T> const GUID &__wine_uuidof();
40 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
42 template<> inline const GUID &__wine_uuidof<type>() { \
43 static const IID __uuid_inst = {l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \
46 template<> inline const GUID &__wine_uuidof<type*>() { \
47 return __wine_uuidof<type>(); \
51 #define __uuidof(type) __wine_uuidof<typeof(type)>()
55 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
65 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
66 EXTERN_C const GUID name DECLSPEC_HIDDEN; \
67 EXTERN_C const GUID name = \
68 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
70 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
71 const GUID name DECLSPEC_HIDDEN; \
73 { 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
80 #define DEFINE_OLEGUID(name, l, w1, w2) \
81 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
86 #ifndef __LPGUID_DEFINED__
87 #define __LPGUID_DEFINED__
91 #ifndef __LPCGUID_DEFINED__
92 #define __LPCGUID_DEFINED__
93 typedef const GUID *LPCGUID;
96 #ifndef __IID_DEFINED__
97 #define __IID_DEFINED__
99 typedef GUID IID,*LPIID;
100 typedef GUID CLSID,*LPCLSID;
101 typedef GUID FMTID,*LPFMTID;
102 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
103 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
104 #define IsEqualFMTID(rfmtid1, rfmtid2) IsEqualGUID(rfmtid1, rfmtid2)
105 #define IID_NULL GUID_NULL
106 #define CLSID_NULL GUID_NULL
107 #define FMTID_NULL GUID_NULL
112 #define __MIDL_CONST const
115 #endif /* ndef __IID_DEFINED__ */
118 #define REFGUID const GUID &
119 #define REFCLSID const CLSID &
120 #define REFIID const IID &
121 #define REFFMTID const FMTID &
122 #else /* !defined(__cplusplus) && !defined(CINTERFACE) */
123 #define REFGUID const GUID* __MIDL_CONST
124 #define REFCLSID const CLSID* __MIDL_CONST
125 #define REFIID const IID* __MIDL_CONST
126 #define REFFMTID const FMTID* __MIDL_CONST
127 #endif /* !defined(__cplusplus) && !defined(CINTERFACE) */
129 #if defined(__cplusplus) && !defined(CINTERFACE)
130 #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
131 #else /* defined(__cplusplus) && !defined(CINTERFACE) */
132 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
133 #endif /* defined(__cplusplus) && !defined(CINTERFACE) */
135 #if defined(__cplusplus) && !defined(CINTERFACE)
137 inline bool operator==(const GUID& guidOne, const GUID& guidOther)
139 return !memcmp(&guidOne,&guidOther,sizeof(GUID));
141 inline bool operator!=(const GUID& guidOne, const GUID& guidOther)
143 return !(guidOne == guidOther);
147 extern const IID GUID_NULL;
149 #endif /* _GUIDDEF_H_ */