configure: use relative paths for in-tree build
[tinycc.git] / win32 / include / winapi / guiddef.h
blob69acfe283461640c4cbc8f1e31022980b7f38e4d
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 #ifndef GUID_DEFINED
7 #define GUID_DEFINED
8 typedef struct _GUID {
9 unsigned long Data1;
10 unsigned short Data2;
11 unsigned short Data3;
12 unsigned char Data4[8 ];
13 } GUID;
14 #endif
16 #ifndef FAR
17 #define FAR
18 #endif
20 #ifndef DECLSPEC_SELECTANY
21 #define DECLSPEC_SELECTANY __declspec(selectany)
22 #endif
24 #ifndef EXTERN_C
25 #ifdef __cplusplus
26 #define EXTERN_C extern "C"
27 #else
28 #define EXTERN_C extern
29 #endif
30 #endif
32 #ifdef DEFINE_GUID
33 #undef DEFINE_GUID
34 #endif
36 #ifdef INITGUID
37 #ifdef __cplusplus
38 #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } }
39 #else
40 #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } }
41 #endif
42 #else
43 #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
44 #endif
46 #define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
48 #ifndef _GUIDDEF_H_
49 #define _GUIDDEF_H_
51 #ifndef __LPGUID_DEFINED__
52 #define __LPGUID_DEFINED__
53 typedef GUID *LPGUID;
54 #endif
56 #ifndef __LPCGUID_DEFINED__
57 #define __LPCGUID_DEFINED__
58 typedef const GUID *LPCGUID;
59 #endif
61 #ifndef __IID_DEFINED__
62 #define __IID_DEFINED__
64 typedef GUID IID;
65 typedef IID *LPIID;
66 #define IID_NULL GUID_NULL
67 #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
68 typedef GUID CLSID;
69 typedef CLSID *LPCLSID;
70 #define CLSID_NULL GUID_NULL
71 #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
72 typedef GUID FMTID;
73 typedef FMTID *LPFMTID;
74 #define FMTID_NULL GUID_NULL
75 #define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2)
77 #ifdef __midl_proxy
78 #define __MIDL_CONST
79 #else
80 #define __MIDL_CONST const
81 #endif
83 #ifndef _REFGUID_DEFINED
84 #define _REFGUID_DEFINED
85 #ifdef __cplusplus
86 #define REFGUID const GUID &
87 #else
88 #define REFGUID const GUID *__MIDL_CONST
89 #endif
90 #endif
92 #ifndef _REFIID_DEFINED
93 #define _REFIID_DEFINED
94 #ifdef __cplusplus
95 #define REFIID const IID &
96 #else
97 #define REFIID const IID *__MIDL_CONST
98 #endif
99 #endif
101 #ifndef _REFCLSID_DEFINED
102 #define _REFCLSID_DEFINED
103 #ifdef __cplusplus
104 #define REFCLSID const IID &
105 #else
106 #define REFCLSID const IID *__MIDL_CONST
107 #endif
108 #endif
110 #ifndef _REFFMTID_DEFINED
111 #define _REFFMTID_DEFINED
112 #ifdef __cplusplus
113 #define REFFMTID const IID &
114 #else
115 #define REFFMTID const IID *__MIDL_CONST
116 #endif
117 #endif
118 #endif
120 #ifndef _SYS_GUID_OPERATORS_
121 #define _SYS_GUID_OPERATORS_
122 #include <string.h>
124 #ifdef __cplusplus
125 __inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) {
126 return (((unsigned long *) &rguid1)[0]==((unsigned long *) &rguid2)[0] && ((unsigned long *) &rguid1)[1]==((unsigned long *) &rguid2)[1] &&
127 ((unsigned long *) &rguid1)[2]==((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3]==((unsigned long *) &rguid2)[3]);
129 __inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); }
130 #else
131 #define InlineIsEqualGUID(rguid1,rguid2) (((unsigned long *) rguid1)[0]==((unsigned long *) rguid2)[0] && ((unsigned long *) rguid1)[1]==((unsigned long *) rguid2)[1] && ((unsigned long *) rguid1)[2]==((unsigned long *) rguid2)[2] && ((unsigned long *) rguid1)[3]==((unsigned long *) rguid2)[3])
132 #define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID)))
133 #endif
135 #ifdef __INLINE_ISEQUAL_GUID
136 #undef IsEqualGUID
137 #define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2)
138 #endif
140 #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
141 #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
143 #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
144 #define _SYS_GUID_OPERATOR_EQ_
145 #ifdef __cplusplus
146 __inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); }
147 __inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); }
148 #endif
149 #endif
150 #endif
151 #endif