home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / cecko / install / devcpp4920.exe / include / basetyps.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-14  |  4.1 KB  |  138 lines

  1. #ifndef _BASETYPS_H
  2. #define _BASETYPS_H
  3.  
  4. #ifndef __OBJC__
  5. #ifdef __cplusplus
  6. #define EXTERN_C extern "C"
  7. #else
  8. #define EXTERN_C extern
  9. #endif
  10. #define STDMETHODCALLTYPE    __stdcall
  11. #define STDMETHODVCALLTYPE    __cdecl
  12. #define STDAPICALLTYPE    __stdcall
  13. #define STDAPIVCALLTYPE    __cdecl
  14. #define STDAPI    EXTERN_C HRESULT STDAPICALLTYPE
  15. #define STDAPI_(t)    EXTERN_C t STDAPICALLTYPE
  16. #define STDMETHODIMP    HRESULT STDMETHODCALLTYPE
  17. #define STDMETHODIMP_(t)    t STDMETHODCALLTYPE
  18. #define STDAPIV    EXTERN_C HRESULT STDAPIVCALLTYPE
  19. #define STDAPIV_(t)    EXTERN_C t STDAPIVCALLTYPE
  20. #define STDMETHODIMPV    HRESULT STDMETHODVCALLTYPE
  21. #define STDMETHODIMPV_(t)    t STDMETHODVCALLTYPE
  22. #define interface    struct
  23. #if defined(__cplusplus) && !defined(CINTERFACE)
  24. #define STDMETHOD(m)    virtual HRESULT STDMETHODCALLTYPE m
  25. #define STDMETHOD_(t,m)    virtual t STDMETHODCALLTYPE m
  26. #define PURE    =0
  27. #define THIS_
  28. #define THIS    void
  29. #if defined(__GNUC__) && !defined(NOCOMATTRIBUTE)
  30. #define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
  31. #define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
  32. #else
  33. #define DECLARE_INTERFACE(i) interface i
  34. #define DECLARE_INTERFACE_(i,b) interface i : public b
  35. #endif
  36. #else
  37. #define STDMETHOD(m)    HRESULT(STDMETHODCALLTYPE *m)
  38. #define STDMETHOD_(t,m)    t(STDMETHODCALLTYPE *m)
  39. #define PURE
  40. #define THIS_    INTERFACE *,
  41. #define THIS    INTERFACE *
  42. #ifndef CONST_VTABLE
  43. #define CONST_VTABLE
  44. #endif
  45. #define DECLARE_INTERFACE(i) \
  46. typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
  47. typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
  48. CONST_VTABLE struct i##Vtbl
  49. #define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
  50. #endif
  51. #define BEGIN_INTERFACE
  52. #define END_INTERFACE
  53.  
  54. #define FWD_DECL(i) typedef interface i i
  55. #if defined(__cplusplus) && !defined(CINTERFACE)
  56. #define IENUM_THIS(T)
  57. #define IENUM_THIS_(T)
  58. #else
  59. #define IENUM_THIS(T) T*
  60. #define IENUM_THIS_(T) T*,
  61. #endif
  62. #define DECLARE_ENUMERATOR_(I,T) \
  63. DECLARE_INTERFACE_(I,IUnknown) \
  64. { \
  65.     STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
  66.     STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
  67.     STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
  68.     STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
  69.     STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
  70.     STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
  71.     STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
  72. }
  73. #define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
  74.  
  75. #endif /* __OBJC__ */
  76.  
  77. #ifndef _GUID_DEFINED /* also defined in winnt.h */
  78. #define _GUID_DEFINED
  79. typedef struct _GUID
  80. {
  81.     unsigned long Data1;
  82.     unsigned short Data2;
  83.     unsigned short Data3;
  84.     unsigned char Data4[8];
  85. } GUID,*REFGUID,*LPGUID;
  86. #endif /* _GUID_DEFINED */
  87. #ifndef UUID_DEFINED
  88. #define UUID_DEFINED
  89. typedef GUID UUID;
  90. #endif /* UUID_DEFINED */
  91. typedef GUID IID;
  92. typedef GUID CLSID;
  93. typedef CLSID *LPCLSID;
  94. typedef IID *LPIID;
  95. typedef IID *REFIID;
  96. typedef CLSID *REFCLSID;
  97. typedef GUID FMTID;
  98. typedef FMTID *REFFMTID;
  99. typedef unsigned long error_status_t;
  100. #define uuid_t UUID
  101. typedef unsigned long PROPID;
  102.  
  103. #ifndef _REFGUID_DEFINED
  104. #ifdef __cplusplus
  105. #define REFGUID const GUID&
  106. #define REFIID const IID&
  107. #define REFCLSID const CLSID&
  108. #else
  109. #define REFGUID const GUID* const
  110. #define REFIID const IID* const
  111. #define REFCLSID const CLSID* const
  112. #endif
  113. #define _REFGUID_DEFINED
  114. #define _REFGIID_DEFINED
  115. #define _REFCLSID_DEFINED
  116. #endif
  117. #ifndef GUID_SECTION
  118. #define GUID_SECTION ".text"
  119. #endif
  120. #ifdef __GNUC__
  121. #define GUID_SECT __attribute__ ((section (GUID_SECTION)))
  122. #else
  123. #define GUID_SECT
  124. #endif
  125. #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
  126. #define GUID_EXT EXTERN_C
  127. #else
  128. #define GUID_EXT
  129. #endif
  130. #ifdef INITGUID
  131. #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
  132. #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
  133. #else
  134. #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
  135. #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
  136. #endif
  137. #endif
  138.