widl: Don't output C++ default value if the argument is followed by another without default value.

This commit is contained in:
Jacek Caban 2015-07-26 18:07:37 +02:00 committed by Alexandre Julliard
parent 2e9a2d8062
commit dd58fcc10e
1 changed files with 12 additions and 2 deletions

View File

@ -937,8 +937,18 @@ void write_args(FILE *h, const var_list_t *args, const char *name, int method, i
if (method == 2) {
const expr_t *expr = get_attrp(arg->attrs, ATTR_DEFAULTVALUE);
if (expr) {
fprintf(h, " = ");
write_expr( h, expr, 0, 1, NULL, NULL, "" );
const var_t *tail_arg;
/* Output default value only if all following arguments also have default value. */
LIST_FOR_EACH_ENTRY_REV( tail_arg, args, const var_t, entry ) {
if(tail_arg == arg) {
fprintf(h, " = ");
write_expr( h, expr, 0, 1, NULL, NULL, "" );
break;
}
if(!get_attrp(tail_arg->attrs, ATTR_DEFAULTVALUE))
break;
}
}
}
count++;