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

Last change on this file since 21520 was 21520, checked in by dmik, 15 years ago

Prevent underscore in GUID_NULL on EMX.

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 *LPCGUID;
36#endif
37
38#undef DEFINE_GUID
39
40#ifdef INITGUID
41#ifdef __EMX__
42#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
43 extern const GUID name asm(#name); /* suppress underscore */ \
44 const GUID name = \
45 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
46#else
47#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
48 extern const GUID name = \
49 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
50#endif
51#else /* INITGUID */
52#ifdef __EMX__
53#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
54 extern const GUID name asm(#name) /* suppress underscore */
55#else
56#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
57 extern const GUID name
58#endif
59#endif
60
61#define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
62
63#ifndef __LPGUID_DEFINED__
64#define __LPGUID_DEFINED__
65typedef GUID *LPGUID;
66typedef GUID CLSID,*LPCLSID;
67#endif
68
69#ifndef __IID_DEFINED__
70#define __IID_DEFINED__
71typedef GUID IID,*LPIID;
72#endif /* ndef __IID_DEFINED__ */
73typedef GUID FMTID,*LPFMTID;
74
75#ifdef __midl_proxy
76#define __MIDL_CONST
77#else
78#define __MIDL_CONST const
79#endif
80
81#if defined(__cplusplus) && !defined(CINTERFACE)
82#define REFGUID const GUID &
83#define REFCLSID const CLSID &
84#define REFIID const IID &
85#define REFFMTID const FMTID &
86#else /* !defined(__cplusplus) && !defined(CINTERFACE) */
87#define REFGUID const GUID* __MIDL_CONST
88#define REFCLSID const CLSID* __MIDL_CONST
89#define REFIID const IID* __MIDL_CONST
90#define REFFMTID const FMTID* __MIDL_CONST
91#endif /* !defined(__cplusplus) && !defined(CINTERFACE) */
92
93#if defined(__cplusplus) && !defined(CINTERFACE)
94#define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
95#else /* defined(__cplusplus) && !defined(CINTERFACE) */
96#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
97#endif /* defined(__cplusplus) && !defined(CINTERFACE) */
98#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
99#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
100
101#if defined(__cplusplus) && !defined(CINTERFACE)
102#include <string.h>
103inline BOOL operator==(const GUID& guidOne, const GUID& guidOther)
104{
105 return !memcmp(&guidOne,&guidOther,sizeof(GUID));
106}
107inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther)
108{
109 return !(guidOne == guidOther);
110}
111#endif
112
113#ifdef __EMX__
114extern const IID GUID_NULL asm("GUID_NULL"); /* suppress underscore */
115#else
116extern const IID GUID_NULL;
117#endif
118
119#define IID_NULL GUID_NULL
120#define CLSID_NULL GUID_NULL
121#define FMTID_NULL GUID_NULL
122
123#endif /* _GUIDDEF_H_ */
Note: See TracBrowser for help on using the repository browser.