The same entries can have a different call_as between the synchronous and asynchronous interfaces and shouldn't be mixed up. --- tools/widl/header.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c index 223ab5c5ca9..43be8d74cbe 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -1535,7 +1535,7 @@ static void write_com_interface_start(FILE *header, const type_t *iface) fprintf(header,"#define __%s_%sINTERFACE_DEFINED__\n\n", iface->c_name, dispinterface ? "DISP" : ""); }
-static void write_com_interface_end(FILE *header, type_t *iface) +static void write_com_interface_end(FILE *header, type_t *iface, int as_async) { int dispinterface = is_attr(iface->attrs, ATTR_DISPINTERFACE); const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); @@ -1614,7 +1614,8 @@ static void write_com_interface_end(FILE *header, type_t *iface) if (!dispinterface && !winrt_mode) { write_method_proto(header, iface); - write_locals(header, iface, FALSE); + if (!as_async) + write_locals(header, iface, FALSE); fprintf(header, "\n"); } fprintf(header, "#endif /* __%s_%sINTERFACE_DEFINED__ */\n", iface->c_name, dispinterface ? "DISP" : ""); @@ -1808,11 +1809,11 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons { write_com_interface_start(header, iface); write_header_stmts(header, type_iface_get_stmts(iface), stmt->u.type, TRUE); - write_com_interface_end(header, iface); + write_com_interface_end(header, iface, FALSE); if (async_iface) { write_com_interface_start(header, async_iface); - write_com_interface_end(header, async_iface); + write_com_interface_end(header, async_iface, TRUE); } } else