oleaut32: Add V_RECORD() and V_RECORDINFO() and use them for wine_dbgstr_variant().

This fixes the wine_dbgstr_variant() compatibility with non __STDC__
compilers and source code that defines _FORCENAMELESSUNION.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Francois Gouget 2015-10-27 11:58:14 +01:00 committed by Alexandre Julliard
parent a7f124ae31
commit be3fea546d
2 changed files with 9 additions and 5 deletions

View File

@ -105,11 +105,15 @@ HRESULT WINAPI GetRecordInfoFromGuids(REFGUID,ULONG,ULONG,LCID,REFGUID,IRecordIn
/* Macros for accessing the fields of the VARIANT type */
#if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
#define V_UNION(A,B) ((A)->n1.n2.n3.B)
#define V_VT(A) ((A)->n1.n2.vt)
#define V_VT(A) ((A)->n1.n2.vt)
#define V_UNION(A,B) ((A)->n1.n2.n3.B)
#define V_RECORD(A) (V_UNION(A,brecVal).pvRecord)
#define V_RECORDINFO(A) (V_UNION(A,brecVal).pRecInfo)
#else
#define V_UNION(A,B) ((A)->B)
#define V_VT(A) ((A)->vt)
#define V_VT(A) ((A)->vt)
#define V_UNION(A,B) ((A)->B)
#define V_RECORD(A) ((A)->pvRecord)
#define V_RECORDINFO(A) ((A)->pRecInfo)
#endif
#define V_ISBYREF(A) (V_VT(A) & VT_BYREF)

View File

@ -331,7 +331,7 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
case VT_VOID:
return wine_dbg_sprintf( "%p {VT_VOID}", v );
case VT_RECORD:
return wine_dbg_sprintf( "%p {VT_RECORD: %p %p}", v, V_UNION(v,brecVal).pvRecord, V_UNION(v,brecVal).pRecInfo );
return wine_dbg_sprintf( "%p {VT_RECORD: %p %p}", v, V_RECORD(v), V_RECORDINFO(v) );
default:
return wine_dbg_sprintf( "%p {vt %s}", v, wine_dbgstr_vt(V_VT(v)) );
}