1 // Common/MyGuidDef.h 2 3 // #pragma message "Common/MyGuidDef.h" 4 5 #ifndef GUID_DEFINED 6 #define GUID_DEFINED 7 8 // #pragma message "GUID_DEFINED" 9 10 #include "MyTypes.h" 11 12 typedef struct { 13 UInt32 Data1; 14 UInt16 Data2; 15 UInt16 Data3; 16 unsigned char Data4[8]; 17 } GUID; 18 19 #ifdef __cplusplus 20 #define REFGUID const GUID & 21 #else 22 #define REFGUID const GUID * 23 #endif 24 25 // typedef GUID IID; 26 typedef GUID CLSID; 27 28 #define REFCLSID REFGUID 29 #define REFIID REFGUID 30 31 #ifdef __cplusplus 32 inline int operator==(REFGUID g1, REFGUID g2) 33 { 34 for (unsigned i = 0; i < sizeof(g1); i++) 35 if (((const unsigned char *)&g1)[i] != ((const unsigned char *)&g2)[i]) 36 return 0; 37 return 1; 38 } 39 inline int operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); } 40 #endif 41 42 #endif // GUID_DEFINED 43 44 #ifndef EXTERN_C 45 #ifdef __cplusplus 46 #define EXTERN_C extern "C" 47 #else 48 #define EXTERN_C extern 49 #endif 50 #endif 51 52 #ifdef DEFINE_GUID 53 #undef DEFINE_GUID 54 #endif 55 56 #ifdef INITGUID 57 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 58 EXTERN_C const GUID name; \ 59 EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } 60 #else 61 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 62 EXTERN_C const GUID name 63 #endif 64