Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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
  15.  
  16. #ifndef UUID_DEFINED
  17. #define UUID_DEFINED
  18. typedef GUID UUID;
  19. #endif
  20.  
  21. #ifndef FAR
  22. #define FAR
  23. #endif
  24.  
  25. #ifndef DECLSPEC_SELECTANY
  26. #define DECLSPEC_SELECTANY __declspec(selectany)
  27. #endif
  28.  
  29. #ifndef EXTERN_C
  30. #ifdef __cplusplus
  31. #define EXTERN_C extern "C"
  32. #else
  33. #define EXTERN_C extern
  34. #endif
  35. #endif
  36.  
  37. #ifdef DEFINE_GUID
  38. #undef DEFINE_GUID
  39. #endif
  40.  
  41. #ifdef INITGUID
  42. #ifdef __cplusplus
  43. #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 } }
  44. #else
  45. #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 } }
  46. #endif
  47. #else
  48. #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
  49. #endif
  50.  
  51. #define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
  52.  
  53. #ifndef _GUIDDEF_H_
  54. #define _GUIDDEF_H_
  55.  
  56. #ifndef __LPGUID_DEFINED__
  57. #define __LPGUID_DEFINED__
  58. typedef GUID *LPGUID;
  59. #endif
  60.  
  61. #ifndef __LPCGUID_DEFINED__
  62. #define __LPCGUID_DEFINED__
  63. typedef const GUID *LPCGUID;
  64. #endif
  65.  
  66. #ifndef __IID_DEFINED__
  67. #define __IID_DEFINED__
  68.  
  69. typedef GUID IID;
  70. typedef IID *LPIID;
  71. #define IID_NULL GUID_NULL
  72. #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
  73. typedef GUID CLSID;
  74. typedef CLSID *LPCLSID;
  75. #define CLSID_NULL GUID_NULL
  76. #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
  77. typedef GUID FMTID;
  78. typedef FMTID *LPFMTID;
  79. #define FMTID_NULL GUID_NULL
  80. #define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2)
  81.  
  82. #ifdef __midl_proxy
  83. #define __MIDL_CONST
  84. #else
  85. #define __MIDL_CONST const
  86. #endif
  87.  
  88. #ifndef _REFGUID_DEFINED
  89. #define _REFGUID_DEFINED
  90. #ifdef __cplusplus
  91. #define REFGUID const GUID &
  92. #else
  93. #define REFGUID const GUID *__MIDL_CONST
  94. #endif
  95. #endif
  96.  
  97. #ifndef _REFIID_DEFINED
  98. #define _REFIID_DEFINED
  99. #ifdef __cplusplus
  100. #define REFIID const IID &
  101. #else
  102. #define REFIID const IID *__MIDL_CONST
  103. #endif
  104. #endif
  105.  
  106. #ifndef _REFCLSID_DEFINED
  107. #define _REFCLSID_DEFINED
  108. #ifdef __cplusplus
  109. #define REFCLSID const IID &
  110. #else
  111. #define REFCLSID const IID *__MIDL_CONST
  112. #endif
  113. #endif
  114.  
  115. #ifndef _REFFMTID_DEFINED
  116. #define _REFFMTID_DEFINED
  117. #ifdef __cplusplus
  118. #define REFFMTID const IID &
  119. #else
  120. #define REFFMTID const IID *__MIDL_CONST
  121. #endif
  122. #endif
  123. #endif
  124.  
  125. #ifndef _SYS_GUID_OPERATORS_
  126. #define _SYS_GUID_OPERATORS_
  127. #include <string.h>
  128.  
  129. #ifdef __cplusplus
  130. __inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) {
  131.   return (((unsigned long *) &rguid1)[0]==((unsigned long *) &rguid2)[0] && ((unsigned long *) &rguid1)[1]==((unsigned long *) &rguid2)[1] &&
  132.     ((unsigned long *) &rguid1)[2]==((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3]==((unsigned long *) &rguid2)[3]);
  133. }
  134. __inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); }
  135. #else
  136. #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])
  137. #define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID)))
  138. #endif
  139.  
  140. #ifdef __INLINE_ISEQUAL_GUID
  141. #undef IsEqualGUID
  142. #define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2)
  143. #endif
  144.  
  145. #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
  146. #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
  147.  
  148. #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
  149. #define _SYS_GUID_OPERATOR_EQ_
  150. #ifdef __cplusplus
  151. __inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); }
  152. __inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); }
  153. #endif
  154. #endif
  155. #endif
  156. #endif
  157.