source: trunk/include/win/guiddef.h@ 22018

Last change on this file since 22018 was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 3.9 KB
Line 
1/*
2 * Copyright (C) 2000 Alexandre Julliard
3 *
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.
8 *
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.
13 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _GUIDDEF_H_
20#define _GUIDDEF_H_
21
22#ifndef GUID_DEFINED
23#define GUID_DEFINED
24typedef struct _GUID
25{
26 unsigned long Data1;
27 unsigned short Data2;
28 unsigned short Data3;
29 unsigned char Data4[ 8 ];
30} GUID;
31#endif
32
33#ifndef __LPCGUID_DEFINED__
34#define __LPCGUID_DEFINED__
35typedef const GUID *PCGUID;
36typedef const GUID *LPCGUID;
37#endif
38
39#undef DEFINE_GUID
40
41#ifdef INITGUID
42#ifdef __EMX__
43#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
44 extern const GUID name asm(#name); /* suppress underscore */ \
45 const GUID name = \
46 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
47#else
48#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
49 extern const GUID name = \
50 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
51#endif
52#else /* INITGUID */
53#ifdef __EMX__
54#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
55 extern const GUID name asm(#name) /* suppress underscore */
56#else
57#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
58 extern const GUID name
59#endif
60#endif
61
62#define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
63
64#ifndef __LPGUID_DEFINED__
65#define __LPGUID_DEFINED__
66typedef GUID *LPGUID;
67typedef GUID CLSID,*LPCLSID;
68#endif
69
70#ifndef __IID_DEFINED__
71#define __IID_DEFINED__
72typedef GUID IID,*LPIID;
73#endif /* ndef __IID_DEFINED__ */
74typedef GUID FMTID,*LPFMTID;
75
76#ifdef __midl_proxy
77#define __MIDL_CONST
78#else
79#define __MIDL_CONST const
80#endif
81
82#if defined(__cplusplus) && !defined(CINTERFACE)
83#define REFGUID const GUID &
84#define REFCLSID const CLSID &
85#define REFIID const IID &
86#define REFFMTID const FMTID &
87#else /* !defined(__cplusplus) && !defined(CINTERFACE) */
88#define REFGUID const GUID* __MIDL_CONST
89#define REFCLSID const CLSID* __MIDL_CONST
90#define REFIID const IID* __MIDL_CONST
91#define REFFMTID const FMTID* __MIDL_CONST
92#endif /* !defined(__cplusplus) && !defined(CINTERFACE) */
93
94#if defined(__cplusplus) && !defined(CINTERFACE)
95#define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
96#else /* defined(__cplusplus) && !defined(CINTERFACE) */
97#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
98#endif /* defined(__cplusplus) && !defined(CINTERFACE) */
99#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
100#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
101
102#if defined(__cplusplus) && !defined(CINTERFACE)
103#include <string.h>
104inline BOOL operator==(const GUID& guidOne, const GUID& guidOther)
105{
106 return !memcmp(&guidOne,&guidOther,sizeof(GUID));
107}
108inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther)
109{
110 return !(guidOne == guidOther);
111}
112#endif
113
114#ifdef __EMX__
115extern const IID GUID_NULL asm("GUID_NULL"); /* suppress underscore */
116#else
117extern const IID GUID_NULL;
118#endif
119
120#define IID_NULL GUID_NULL
121#define CLSID_NULL GUID_NULL
122#define FMTID_NULL GUID_NULL
123
124#endif /* _GUIDDEF_H_ */
Note: See TracBrowser for help on using the repository browser.