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

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 27 11:06:36 CDT 2015


Module: wine
Branch: master
Commit: be3fea546d2c0c99726074326e0189ddd829e792
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=be3fea546d2c0c99726074326e0189ddd829e792

Author: Francois Gouget <fgouget at free.fr>
Date:   Tue Oct 27 11:58:14 2015 +0100

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 at free.fr>
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/oleauto.h    | 12 ++++++++----
 include/wine/debug.h |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/oleauto.h b/include/oleauto.h
index f9862e7..07c46ad 100644
--- a/include/oleauto.h
+++ b/include/oleauto.h
@@ -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)
diff --git a/include/wine/debug.h b/include/wine/debug.h
index 241e79b..af5483c 100644
--- a/include/wine/debug.h
+++ b/include/wine/debug.h
@@ -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)) );
     }




More information about the wine-cvs mailing list