Commit be3fea54 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

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: 's avatarFrancois Gouget <fgouget@free.fr> Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a7f124ae
......@@ -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)
......
......@@ -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)) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment