widl: Fixup the defaultvalue(BSTR) expression type like midl does.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2015-11-27 18:00:27 +08:00 committed by Alexandre Julliard
parent 7365f557b6
commit b53c5b30b2
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include "header.h" #include "header.h"
#include "expr.h" #include "expr.h"
#include "typetree.h" #include "typetree.h"
#include "typelib.h"
static int indentation = 0; static int indentation = 0;
static int is_object_interface = 0; static int is_object_interface = 0;
@ -1009,6 +1010,16 @@ void write_args(FILE *h, const var_list_t *args, const char *name, int method, i
/* Output default value only if all following arguments also have default value. */ /* Output default value only if all following arguments also have default value. */
LIST_FOR_EACH_ENTRY_REV( tail_arg, args, const var_t, entry ) { LIST_FOR_EACH_ENTRY_REV( tail_arg, args, const var_t, entry ) {
if(tail_arg == arg) { if(tail_arg == arg) {
expr_t bstr;
/* Fixup the expression type for a BSTR like midl does. */
if (get_type_vt(arg->type) == VT_BSTR && expr->type == EXPR_STRLIT)
{
bstr = *expr;
bstr.type = EXPR_WSTRLIT;
expr = &bstr;
}
fprintf(h, " = "); fprintf(h, " = ");
write_expr( h, expr, 0, 1, NULL, NULL, "" ); write_expr( h, expr, 0, 1, NULL, NULL, "" );
break; break;