Signed-off-by: Serge Gautherie winehq-git_serge_180711@gautherie.fr --- include/guiddef.h | 62 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 12 deletions(-)
diff --git a/include/guiddef.h b/include/guiddef.h index 1871910..accccb6 100644 --- a/include/guiddef.h +++ b/include/guiddef.h @@ -84,7 +84,9 @@ extern "C++" {
#endif
+#ifdef DEFINE_GUID #undef DEFINE_GUID +#endif
#ifdef INITGUID #ifdef __cplusplus @@ -138,20 +140,49 @@ typedef GUID FMTID,*LPFMTID; #define __MIDL_CONST const #endif
-#endif /* ndef __IID_DEFINED__ */ +#ifndef _REFGUID_DEFINED +#define _REFGUID_DEFINED +#ifdef __cplusplus +#define REFGUID const GUID & +#else +#define REFGUID const GUID * __MIDL_CONST +#endif +#endif
+#ifndef _REFIID_DEFINED +#define _REFIID_DEFINED #ifdef __cplusplus -#define REFGUID const GUID & -#define REFCLSID const CLSID & -#define REFIID const IID & -#define REFFMTID const FMTID & +#define REFIID const IID & #else -#define REFGUID const GUID* __MIDL_CONST -#define REFCLSID const CLSID* __MIDL_CONST -#define REFIID const IID* __MIDL_CONST -#define REFFMTID const FMTID* __MIDL_CONST +#define REFIID const IID * __MIDL_CONST +#endif #endif
+#ifndef _REFCLSID_DEFINED +#define _REFCLSID_DEFINED +#ifdef __cplusplus +#define REFCLSID const CLSID & +#else +#define REFCLSID const CLSID * __MIDL_CONST +#endif +#endif + +#ifndef _REFFMTID_DEFINED +#define _REFFMTID_DEFINED +#ifdef __cplusplus +#define REFFMTID const FMTID & +#else +#define REFFMTID const FMTID * __MIDL_CONST +#endif +#endif + +#endif /* __IID_DEFINED__ */ + +#if !defined(_SYS_GUID_OPERATORS_) +#define _SYS_GUID_OPERATORS_ + +#include <string.h> + #ifdef __cplusplus #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID))) inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) @@ -170,16 +201,23 @@ inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) ((ULONG *)rguid1)[3] == ((ULONG *)rguid2)[3]) #endif
+#if !defined(_SYS_GUID_OPERATOR_EQ_) && !defined(_NO_SYS_GUID_OPERATOR_EQ_) +#define _SYS_GUID_OPERATOR_EQ_ + #ifdef __cplusplus -#include <string.h> -inline bool operator==(const GUID& guidOne, const GUID& guidOther) +inline bool operator==(REFGUID guidOne, REFGUID guidOther) { return !memcmp(&guidOne,&guidOther,sizeof(GUID)); } -inline bool operator!=(const GUID& guidOne, const GUID& guidOther) + +inline bool operator!=(REFGUID guidOne, REFGUID guidOther) { return !(guidOne == guidOther); } #endif
+#endif /* _SYS_GUID_OPERATOR_EQ_ */ + +#endif /* _SYS_GUID_OPERATORS_ */ + #endif /* _GUIDDEF_H_ */