Change existing guards to use the above macro names as appropriate.

* include/basetyps.h (__int32, __int16, __int8, small, hyper): Define.
	Note: Also added to mingw/include/_mingw.h.
This commit is contained in:
Earnie Boyd 2003-07-01 13:01:41 +00:00
parent fecdb8380e
commit 6dbe0697a7
2 changed files with 90 additions and 70 deletions

View File

@ -5,6 +5,8 @@
* include/winbase.h (GetLongPathName[AW]): Add guard for OS >= NT5 or * include/winbase.h (GetLongPathName[AW]): Add guard for OS >= NT5 or
>= Win98. >= Win98.
Change existing guards to use the above macro names as appropriate. Change existing guards to use the above macro names as appropriate.
* include/basetyps.h (__int32, __int16, __int8, small, hyper): Define.
Note: Also added to mingw/include/_mingw.h.
2003-06-28 Steven Edwards <Steven_Ed4153@yahoo.com> 2003-06-28 Steven Edwards <Steven_Ed4153@yahoo.com>

View File

@ -5,79 +5,97 @@
#endif #endif
#ifndef __OBJC__ #ifndef __OBJC__
#ifdef __cplusplus # ifdef __cplusplus
#define EXTERN_C extern "C" # define EXTERN_C extern "C"
#else # else
#define EXTERN_C extern # define EXTERN_C extern
#endif /* __cplusplus */ # endif /* __cplusplus */
#define STDMETHODCALLTYPE __stdcall # ifndef __int64
#define STDMETHODVCALLTYPE __cdecl # define __int64 long long
#define STDAPICALLTYPE __stdcall # endif
#define STDAPIVCALLTYPE __cdecl # ifndef __int32
#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE # define __int32 long
#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE # endif
#define STDMETHODIMP HRESULT STDMETHODCALLTYPE # ifndef __int16
#define STDMETHODIMP_(t) t STDMETHODCALLTYPE # define __int16 int
#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE # endif
#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE # ifndef __int8
#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE # define __int8 char
#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE # endif
#define interface struct # ifndef small
#if defined(__cplusplus) && !defined(CINTERFACE) # define small char
#define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m # endif
#define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m # ifndef hyper
#define PURE =0 # define hyper long long
#define THIS_ # endif
#define THIS void # define STDMETHODCALLTYPE __stdcall
# define STDMETHODVCALLTYPE __cdecl
# define STDAPICALLTYPE __stdcall
# define STDAPIVCALLTYPE __cdecl
# define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
# define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
# define STDMETHODIMP HRESULT STDMETHODCALLTYPE
# define STDMETHODIMP_(t) t STDMETHODCALLTYPE
# define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
# define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
# define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
# define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
# define interface struct
# if defined(__cplusplus) && !defined(CINTERFACE)
# define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
# define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
# define PURE =0
# define THIS_
# define THIS void
/* /*
__attribute__((com_interface)) is obsolete in __GNUC__ >= 3 __attribute__((com_interface)) is obsolete in __GNUC__ >= 3
g++ vtables are now COM-compatible by default g++ vtables are now COM-compatible by default
*/ */
#if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE) # if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE)
#define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i # define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
#define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b # define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
#else # else
#define DECLARE_INTERFACE(i) interface i # define DECLARE_INTERFACE(i) interface i
#define DECLARE_INTERFACE_(i,b) interface i : public b # define DECLARE_INTERFACE_(i,b) interface i : public b
#endif # endif
#else # else
#define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m) # define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
#define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m) # define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
#define PURE # define PURE
#define THIS_ INTERFACE *, # define THIS_ INTERFACE *,
#define THIS INTERFACE * # define THIS INTERFACE *
#ifndef CONST_VTABLE # ifndef CONST_VTABLE
#define CONST_VTABLE # define CONST_VTABLE
#endif # endif
#define DECLARE_INTERFACE(i) \ # define DECLARE_INTERFACE(i) \
typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \ typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \ typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
CONST_VTABLE struct i##Vtbl CONST_VTABLE struct i##Vtbl
#define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i) # define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
#endif # endif
#define BEGIN_INTERFACE # define BEGIN_INTERFACE
#define END_INTERFACE # define END_INTERFACE
#define FWD_DECL(i) typedef interface i i # define FWD_DECL(i) typedef interface i i
#if defined(__cplusplus) && !defined(CINTERFACE) # if defined(__cplusplus) && !defined(CINTERFACE)
#define IENUM_THIS(T) # define IENUM_THIS(T)
#define IENUM_THIS_(T) # define IENUM_THIS_(T)
#else # else
#define IENUM_THIS(T) T* # define IENUM_THIS(T) T*
#define IENUM_THIS_(T) T*, # define IENUM_THIS_(T) T*,
#endif # endif
#define DECLARE_ENUMERATOR_(I,T) \ # define DECLARE_ENUMERATOR_(I,T) \
DECLARE_INTERFACE_(I,IUnknown) \ DECLARE_INTERFACE_(I,IUnknown) \
{ \ { \
STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \ STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \ STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \ STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \ STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \ STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \ STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \ STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
} }
#define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T) # define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
#endif /* __OBJC__ */ #endif /* __OBJC__ */