-Rob Shearman <robertshearman at gmail.com> Thu Sep 18 2008

widl: Don't automatically add DUMMYUNIONNAME and DUMMYSTRUCTNAME names to anonymous unions and structs.

-Rob Shearman <robertshearman at gmail.com> Thu Sep 18 2008
include: Add explicit DUMMYUNIONNAME and DUMMYSTRUCTNAME names to anonymous unions in IDL files.

svn path=/trunk/; revision=38609
This commit is contained in:
Christoph von Wittich 2009-01-06 17:52:24 +00:00
parent b85fc47c09
commit 3fc8d752a8
5 changed files with 10 additions and 31 deletions

View file

@ -286,7 +286,7 @@ struct _wireVARIANT {
[case(VT_DISPATCH|VT_BYREF)] IDispatch **ppdispVal;
[case(VT_ARRAY|VT_BYREF)] wireSAFEARRAY *pparray;
[case(VT_RECORD, VT_RECORD|VT_BYREF)] wireBRECORD brecVal;
};
} DUMMYUNIONNAME;
};
/* Dispatch */
@ -313,7 +313,7 @@ typedef struct tagTYPEDESC {
[case(VT_CARRAY)] struct tagARRAYDESC *lpadesc;
[case(VT_USERDEFINED)] HREFTYPE hreftype;
[default] ;
};
} DUMMYUNIONNAME;
VARTYPE vt;
} TYPEDESC;
@ -484,7 +484,7 @@ typedef struct tagVARDESC {
[switch_is(varkind)] union {
[case(VAR_PERINSTANCE, VAR_DISPATCH, VAR_STATIC)] ULONG oInst;
[case(VAR_CONST)] VARIANT *lpvarValue;
};
} DUMMYUNIONNAME;
ELEMDESC elemdescVar;
WORD wVarFlags;
VARKIND varkind;

View file

@ -1378,7 +1378,6 @@ interface IAdviseSink : IUnknown
[size_is(cbData)] byte data[];
} RemSTGMEDIUM;
/* FIXME: C/C++ nameless union version */
typedef struct tagSTGMEDIUM {
DWORD tymed;
[switch_is(tymed)] union {
@ -1390,7 +1389,7 @@ interface IAdviseSink : IUnknown
[case(TYMED_ISTREAM)] IStream *pstm;
[case(TYMED_ISTORAGE)] IStorage *pstg;
[default] ;
};
} DUMMYUNIONNAME;
[unique] IUnknown *pUnkForRelease;
} uSTGMEDIUM;
@ -1425,7 +1424,7 @@ interface IAdviseSink : IUnknown
case TYMED_FILE: LPOLESTR lpszFileName;
case TYMED_ISTREAM: BYTE_BLOB *pstm;
case TYMED_ISTORAGE: BYTE_BLOB *pstg;
};
} DUMMYUNIONNAME;
IUnknown *pUnkForRelease;
} userSTGMEDIUM;

View file

@ -201,7 +201,7 @@ interface IPropertyStorage : IUnknown
[case(VT_BYREF|VT_DISPATCH)] IDispatch **ppdispVal;
[case(VT_BYREF|VT_ARRAY)] LPSAFEARRAY *pparray;
[case(VT_BYREF|VT_VARIANT)] PROPVARIANT *pvarVal;
};
} DUMMYUNIONNAME;
};
typedef struct tagPROPVARIANT *LPPROPVARIANT;
@ -255,7 +255,7 @@ interface IPropertyStorage : IUnknown
[case(PRSPEC_PROPID)] PROPID propid;
[case(PRSPEC_LPWSTR)] LPOLESTR lpwstr;
[default] ;
};
} DUMMYUNIONNAME;
} PROPSPEC;
typedef struct tagSTATPROPSTG {

View file

@ -188,7 +188,7 @@ typedef struct _SC_RPC_CONFIG_INFOA {
[case(5)] LPSERVICE_SID_INFO pssid;
[case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
[case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
};
} DUMMYUNIONNAME;
} SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
typedef struct _SC_RPC_CONFIG_INFOW {
@ -201,7 +201,7 @@ typedef struct _SC_RPC_CONFIG_INFOW {
[case(5)] LPSERVICE_SID_INFO pssid;
[case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
[case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
};
} DUMMYUNIONNAME;
} SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW;
typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 {

View file

@ -150,28 +150,8 @@ static void write_field(FILE *h, var_t *v)
{
if (!v) return;
if (v->type) {
const char *name = v->name;
if (name == NULL) {
switch (v->type->type) {
case RPC_FC_STRUCT:
case RPC_FC_CVSTRUCT:
case RPC_FC_CPSTRUCT:
case RPC_FC_CSTRUCT:
case RPC_FC_PSTRUCT:
case RPC_FC_BOGUS_STRUCT:
case RPC_FC_ENCAPSULATED_UNION:
name = "DUMMYSTRUCTNAME";
break;
case RPC_FC_NON_ENCAPSULATED_UNION:
name = "DUMMYUNIONNAME";
break;
default:
/* ? */
break;
}
}
indent(h, 0);
write_type_def_or_decl(h, v->type, TRUE, "%s", name);
write_type_def_or_decl(h, v->type, TRUE, "%s", v->name);
fprintf(h, ";\n");
}
}