home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / cwin / c.exe / $INSTDIR / include / basetyps.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-12-15  |  4.3 KB  |  149 lines

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