Annotation of elwix/tools/oldlzma/SRC/Common/MyGuidDef.h, revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>