atl80: Fixed some spec file entries.
[wine.git] / include / guiddef.h
blobb7de1b197608e7c8c0da2e53cc704884f598e602
1 /*
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
19 #ifndef GUID_DEFINED
20 #define GUID_DEFINED
21 typedef struct _GUID
23 #ifdef _MSC_VER
24 unsigned long Data1;
25 #else
26 unsigned int Data1;
27 #endif
28 unsigned short Data2;
29 unsigned short Data3;
30 unsigned char Data4[ 8 ];
31 } GUID;
33 /* Macros for __uuidof emulation */
34 #if defined(__cplusplus) && !defined(_MSC_VER)
36 extern "C++" {
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) \
41 extern "C++" { \
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}}; \
44 return __uuid_inst; \
45 } \
46 template<> inline const GUID &__wine_uuidof<type*>() { \
47 return __wine_uuidof<type>(); \
48 } \
51 #define __uuidof(type) __wine_uuidof<typeof(type)>()
53 #else
55 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
57 #endif
59 #endif
61 #undef DEFINE_GUID
63 #ifdef INITGUID
64 #ifdef __cplusplus
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 } }
69 #else
70 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
71 const GUID name DECLSPEC_HIDDEN; \
72 const GUID name = \
73 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
74 #endif
75 #else
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 #endif
80 #define DEFINE_OLEGUID(name, l, w1, w2) \
81 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
83 #ifndef _GUIDDEF_H_
84 #define _GUIDDEF_H_
86 #ifndef __LPGUID_DEFINED__
87 #define __LPGUID_DEFINED__
88 typedef GUID *LPGUID;
89 #endif
91 #ifndef __LPCGUID_DEFINED__
92 #define __LPCGUID_DEFINED__
93 typedef const GUID *LPCGUID;
94 #endif
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
109 #ifdef __midl_proxy
110 #define __MIDL_CONST
111 #else
112 #define __MIDL_CONST const
113 #endif
115 #endif /* ndef __IID_DEFINED__ */
117 #ifdef __cplusplus
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)
136 #include <string.h>
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);
145 #endif
147 extern const IID GUID_NULL;
149 #endif /* _GUIDDEF_H_ */