Rémi Bernon : widl: Output interface C names in method argument list.

Alexandre Julliard julliard at winehq.org
Mon Sep 7 16:12:54 CDT 2020


Module: wine
Branch: master
Commit: 6698a2ef7f1b481fb3e9562c4915fefb39635a86
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6698a2ef7f1b481fb3e9562c4915fefb39635a86

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Sep  3 14:52:07 2020 +0200

widl: Output interface C names in method argument list.

This fixes WinRT interface generation where only simple names were used
instead of the C interface names.

With the previous sample idl:

    #ifdef __WIDL__
    #pragma winrt ns_prefix
    #endif

    import "wtypes.idl";

    namespace Windows {
        [object]
        interface IFoo {}

        [object]
        interface IBar { HRESULT DoBar([in] IFoo *foo); }
    }

$ widl -o windows.foo.h windows.foo.idl

Generated file diff before/after:

    diff --git a/windows.foo.h b/windows.foo.h
    index 3790dc7..65151cb 100644
    --- a/windows.foo.h
    +++ b/windows.foo.h
    @@ -123,7 +123,7 @@ typedef struct __x_ABI_CWindows_CIBarVtbl {
         /*** IBar methods ***/
         HRESULT (STDMETHODCALLTYPE *DoBar)(
             __x_ABI_CWindows_CIBar *This,
    -        IFoo *foo);
    +        __x_ABI_CWindows_CIFoo *foo);

         END_INTERFACE
     } __x_ABI_CWindows_CIBarVtbl;
    @@ -138,7 +138,7 @@ interface __x_ABI_CWindows_CIBar {
     #define __x_ABI_CWindows_CIBar_DoBar(This,foo) (This)->lpVtbl->DoBar(This,foo)
     #else
     /*** IBar methods ***/
    -static FORCEINLINE HRESULT __x_ABI_CWindows_CIBar_DoBar(__x_ABI_CWindows_CIBar* This,IFoo *foo) {
    +static FORCEINLINE HRESULT __x_ABI_CWindows_CIBar_DoBar(__x_ABI_CWindows_CIBar* This,__x_ABI_CWindows_CIFoo *foo) {
         return This->lpVtbl->DoBar(This,foo);
     }
     #endif

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/widl/client.c |  3 +--
 tools/widl/header.c | 42 ++++++++++++++++++++----------------------
 tools/widl/header.h |  2 +-
 tools/widl/proxy.c  |  4 ++--
 4 files changed, 24 insertions(+), 27 deletions(-)

Diff:   https://source.winehq.org/git/wine.git/?a=commitdiff;h=6698a2ef7f1b481fb3e9562c4915fefb39635a86



More information about the wine-cvs mailing list