Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 
      7 /* Make sure __LONG32 is defined.  */
      8 #include <_mingw.h>
      9 
     10 #ifndef GUID_DEFINED
     11 #define GUID_DEFINED
     12 typedef struct _GUID {
     13   unsigned __LONG32 Data1;
     14   unsigned short Data2;
     15   unsigned short Data3;
     16   unsigned char Data4[8 ];
     17 } GUID;
     18 #endif
     19 
     20 #if defined(__cplusplus) && (USE___UUIDOF == 0)
     21 extern "C++" {
     22 __extension__    template<typename T> const GUID &__mingw_uuidof();
     23 }
     24 #endif
     25 
     26 #ifndef FAR
     27 #define FAR
     28 #endif
     29 
     30 #ifndef DECLSPEC_SELECTANY
     31 #define DECLSPEC_SELECTANY __declspec(selectany)
     32 #endif
     33 
     34 #ifndef EXTERN_C
     35 #ifdef __cplusplus
     36 #define EXTERN_C extern "C"
     37 #else
     38 #define EXTERN_C extern
     39 #endif
     40 #endif
     41 
     42 #ifdef DEFINE_GUID
     43 #undef DEFINE_GUID
     44 #endif
     45 
     46 #ifdef INITGUID
     47 #ifdef __cplusplus
     48 #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 } }
     49 #else
     50 #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 } }
     51 #endif
     52 #else
     53 #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
     54 #endif
     55 
     56 #define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
     57 
     58 #ifndef _GUIDDEF_H_
     59 #define _GUIDDEF_H_
     60 
     61 #ifndef __LPGUID_DEFINED__
     62 #define __LPGUID_DEFINED__
     63 typedef GUID *LPGUID;
     64 #endif
     65 
     66 #ifndef __LPCGUID_DEFINED__
     67 #define __LPCGUID_DEFINED__
     68 typedef const GUID *LPCGUID;
     69 #endif
     70 
     71 #ifndef __IID_DEFINED__
     72 #define __IID_DEFINED__
     73 
     74 typedef GUID IID;
     75 typedef IID *LPIID;
     76 #define IID_NULL GUID_NULL
     77 #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
     78 
     79 #ifndef CLSID_DEFINED
     80 #define CLSID_DEFINED
     81 typedef GUID CLSID;
     82 #endif
     83 
     84 typedef CLSID *LPCLSID;
     85 #define CLSID_NULL GUID_NULL
     86 #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
     87 
     88 typedef GUID FMTID;
     89 typedef FMTID *LPFMTID;
     90 #define FMTID_NULL GUID_NULL
     91 #define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2)
     92 
     93 #ifdef __midl_proxy
     94 #define __MIDL_CONST
     95 #else
     96 #define __MIDL_CONST const
     97 #endif
     98 
     99 #ifndef _REFGUID_DEFINED
    100 #define _REFGUID_DEFINED
    101 #ifdef __cplusplus
    102 #define REFGUID const GUID &
    103 #else
    104 #define REFGUID const GUID *__MIDL_CONST
    105 #endif
    106 #endif
    107 
    108 #ifndef _REFIID_DEFINED
    109 #define _REFIID_DEFINED
    110 #ifdef __cplusplus
    111 #define REFIID const IID &
    112 #else
    113 #define REFIID const IID *__MIDL_CONST
    114 #endif
    115 #endif
    116 
    117 #ifndef _REFCLSID_DEFINED
    118 #define _REFCLSID_DEFINED
    119 #ifdef __cplusplus
    120 #define REFCLSID const IID &
    121 #else
    122 #define REFCLSID const IID *__MIDL_CONST
    123 #endif
    124 #endif
    125 
    126 #ifndef _REFFMTID_DEFINED
    127 #define _REFFMTID_DEFINED
    128 #ifdef __cplusplus
    129 #define REFFMTID const IID &
    130 #else
    131 #define REFFMTID const IID *__MIDL_CONST
    132 #endif
    133 #endif
    134 #endif
    135 
    136 #ifndef __WIDL__
    137 #ifndef _SYS_GUID_OPERATORS_
    138 #define _SYS_GUID_OPERATORS_
    139 #include <string.h>
    140 
    141 #ifdef __cplusplus
    142 __inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) {
    143   return (((unsigned __LONG32 *) &rguid1)[0]==((unsigned __LONG32 *) &rguid2)[0] && ((unsigned __LONG32 *) &rguid1)[1]==((unsigned __LONG32 *) &rguid2)[1] &&
    144     ((unsigned __LONG32 *) &rguid1)[2]==((unsigned __LONG32 *) &rguid2)[2] && ((unsigned __LONG32 *) &rguid1)[3]==((unsigned __LONG32 *) &rguid2)[3]);
    145 }
    146 __inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); }
    147 #else
    148 #define InlineIsEqualGUID(rguid1,rguid2) (((unsigned __LONG32 *) rguid1)[0]==((unsigned __LONG32 *) rguid2)[0] && ((unsigned __LONG32 *) rguid1)[1]==((unsigned __LONG32 *) rguid2)[1] && ((unsigned __LONG32 *) rguid1)[2]==((unsigned __LONG32 *) rguid2)[2] && ((unsigned __LONG32 *) rguid1)[3]==((unsigned __LONG32 *) rguid2)[3])
    149 #define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID)))
    150 #endif
    151 
    152 #ifdef __INLINE_ISEQUAL_GUID
    153 #undef IsEqualGUID
    154 #define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2)
    155 #endif
    156 
    157 #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
    158 #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
    159 
    160 #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
    161 #define _SYS_GUID_OPERATOR_EQ_
    162 #ifdef __cplusplus
    163 __inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); }
    164 __inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); }
    165 #endif
    166 #endif
    167 #endif
    168 #endif
    169 #endif
    170