Commit 2330d73f authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

widl: Implement the writing of defaultvalue constants for enum values.

parent fc6febc8
...@@ -1362,18 +1362,28 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index) ...@@ -1362,18 +1362,28 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index)
switch(attr->type) { switch(attr->type) {
case ATTR_DEFAULTVALUE_EXPR: case ATTR_DEFAULTVALUE_EXPR:
{ {
int vt;
expr_t *expr = (expr_t *)attr->u.pval; expr_t *expr = (expr_t *)attr->u.pval;
if (arg->type->type == RPC_FC_ENUM16)
vt = VT_INT;
else
vt = get_var_vt(arg);
paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */ paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */
chat("default value %ld\n", expr->cval); chat("default value %ld\n", expr->cval);
write_value(typeinfo->typelib, defaultdata, (*paramdata >> 16) & 0x1ff, &expr->cval); write_value(typeinfo->typelib, defaultdata, vt, &expr->cval);
break; break;
} }
case ATTR_DEFAULTVALUE_STRING: case ATTR_DEFAULTVALUE_STRING:
{ {
char *s = (char *)attr->u.pval; char *s = (char *)attr->u.pval;
int vt;
if (arg->type->type == RPC_FC_ENUM16)
vt = VT_INT;
else
vt = get_var_vt(arg);
paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */ paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */
chat("default value '%s'\n", s); chat("default value '%s'\n", s);
write_value(typeinfo->typelib, defaultdata, (*paramdata >> 16) & 0x1ff, s); write_value(typeinfo->typelib, defaultdata, vt, s);
break; break;
} }
case ATTR_IN: case ATTR_IN:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment