Moved ICOM_THIS_MULTI definition out of objbase.h and into the files

that use it.
This commit is contained in:
Alexandre Julliard 2004-08-13 00:44:22 +00:00
parent ff039ccdf3
commit 936198ce45
16 changed files with 29 additions and 2 deletions

View File

@ -31,6 +31,8 @@
#include "comcat.h" #include "comcat.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/********************************************************************** /**********************************************************************
* Dll lifetime tracking declaration for comcat.dll * Dll lifetime tracking declaration for comcat.dll
*/ */

View File

@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */ DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/** /**
* Parsing utilities * Parsing utilities
*/ */

View File

@ -267,6 +267,8 @@ typedef struct {
#define FE(x) { x, #x } #define FE(x) { x, #x }
#define GE(x) { &x, #x } #define GE(x) { &x, #x }
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/* check whether the given DWORD is even (return 0) or odd (return 1) */ /* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number); extern int even_or_odd (DWORD number);
/* FOURCC to string conversion for debug messages */ /* FOURCC to string conversion for debug messages */

View File

@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */ DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/** /**
* Parsing utilities * Parsing utilities
*/ */

View File

@ -41,6 +41,8 @@
#include "dmusicf.h" #include "dmusicf.h"
#include "dmusics.h" #include "dmusics.h"
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/* dmloader.dll global (for DllCanUnloadNow) */ /* dmloader.dll global (for DllCanUnloadNow) */
extern DWORD dwDirectMusicLoader; /* number of DirectMusicLoader(CF) instances */ extern DWORD dwDirectMusicLoader; /* number of DirectMusicLoader(CF) instances */
extern DWORD dwDirectMusicContainer; /* number of DirectMusicContainer(CF) instances */ extern DWORD dwDirectMusicContainer; /* number of DirectMusicContainer(CF) instances */

View File

@ -200,6 +200,8 @@ typedef struct {
#define FE(x) { x, #x } #define FE(x) { x, #x }
#define GE(x) { &x, #x } #define GE(x) { &x, #x }
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/* check whether the given DWORD is even (return 0) or odd (return 1) */ /* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number); extern int even_or_odd (DWORD number);
/* FOURCC to string conversion for debug messages */ /* FOURCC to string conversion for debug messages */

View File

@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */ DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/** /**
* Parsing utilities * Parsing utilities
*/ */

View File

@ -412,8 +412,8 @@ void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVO
* Misc. * Misc.
*/ */
/* my custom ICOM stuff */ /* my custom ICOM stuff */
#define ICOM_NAME(impl,iface,name) impl* const name=(impl*)(iface)
#define ICOM_NAME_MULTI(impl,field,iface,name) impl* const name=(impl*)((char*)(iface) - offsetof(impl,field)) #define ICOM_NAME_MULTI(impl,field,iface,name) impl* const name=(impl*)((char*)(iface) - offsetof(impl,field))
#define ICOM_THIS_MULTI(impl,field,iface) ICOM_NAME_MULTI(impl,field,iface,This)
/* for simpler reading */ /* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK { typedef struct _DMUS_PRIVATE_CHUNK {

View File

@ -160,6 +160,8 @@ typedef struct {
#define FE(x) { x, #x } #define FE(x) { x, #x }
#define GE(x) { &x, #x } #define GE(x) { &x, #x }
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/* check whether the given DWORD is even (return 0) or odd (return 1) */ /* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number); extern int even_or_odd (DWORD number);
/* FOURCC to string conversion for debug messages */ /* FOURCC to string conversion for debug messages */

View File

@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang);
#define CP_UNICODE 1200 #define CP_UNICODE 1200
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj); static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
/* FIXME: /* FIXME:

View File

@ -189,4 +189,6 @@ static inline APARTMENT* COM_CurrentApt(void)
APARTMENT* COM_CreateApartment(DWORD model); APARTMENT* COM_CreateApartment(DWORD model);
HWND COM_GetApartmentWin(OXID oxid); HWND COM_GetApartmentWin(OXID oxid);
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
#endif /* __WINE_OLE_COMPOBJ_H */ #endif /* __WINE_OLE_COMPOBJ_H */

View File

@ -53,6 +53,8 @@ static const WCHAR ppvObjectW[] = {'p','p','v','O','b','j','e','c','t',0};
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(olerelay); WINE_DECLARE_DEBUG_CHANNEL(olerelay);
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
typedef struct _marshal_state { typedef struct _marshal_state {
LPBYTE base; LPBYTE base;
int size; int size;

View File

@ -37,6 +37,8 @@
#define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time) #define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time)
#define MSEC_FROM_MEDIATIME(time) ((time) / 10000) #define MSEC_FROM_MEDIATIME(time) ((time) / 10000)
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) ; HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) ;
HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj); HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj);
HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv); HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv);

View File

@ -55,6 +55,8 @@ typedef struct {
static IRpcProxyBufferVtbl StdProxy_Vtbl; static IRpcProxyBufferVtbl StdProxy_Vtbl;
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
/* How the Windows stubless proxy thunks work is explained at /* How the Windows stubless proxy thunks work is explained at
* http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp,
* but I'll use a slightly different method, to make life easier */ * but I'll use a slightly different method, to make life easier */

View File

@ -26,4 +26,6 @@
extern HINSTANCE URLMON_hInstance; extern HINSTANCE URLMON_hInstance;
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
#endif /* __WINE_URLMON_MAIN_H */ #endif /* __WINE_URLMON_MAIN_H */

View File

@ -298,7 +298,6 @@
/* Wine-specific macros */ /* Wine-specific macros */
#define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface) #define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface)
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
#include <objidl.h> #include <objidl.h>