widl: Generate WinRT runtimeclass name constants.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2ca86d3b59
commit
98fcca256a
|
@ -1702,6 +1702,7 @@ static void write_runtimeclass(FILE *header, type_t *runtimeclass)
|
||||||
{
|
{
|
||||||
expr_t *contract = get_attrp(runtimeclass->attrs, ATTR_CONTRACT);
|
expr_t *contract = get_attrp(runtimeclass->attrs, ATTR_CONTRACT);
|
||||||
char *name, *c_name;
|
char *name, *c_name;
|
||||||
|
size_t i, len;
|
||||||
name = format_namespace(runtimeclass->namespace, "", ".", runtimeclass->name, NULL);
|
name = format_namespace(runtimeclass->namespace, "", ".", runtimeclass->name, NULL);
|
||||||
c_name = format_namespace(runtimeclass->namespace, "", "_", runtimeclass->name, NULL);
|
c_name = format_namespace(runtimeclass->namespace, "", "_", runtimeclass->name, NULL);
|
||||||
fprintf(header, "/*\n");
|
fprintf(header, "/*\n");
|
||||||
|
@ -1710,6 +1711,14 @@ static void write_runtimeclass(FILE *header, type_t *runtimeclass)
|
||||||
if (contract) write_apicontract_guard_start(header, contract);
|
if (contract) write_apicontract_guard_start(header, contract);
|
||||||
fprintf(header, "#ifndef RUNTIMECLASS_%s_DEFINED\n", c_name);
|
fprintf(header, "#ifndef RUNTIMECLASS_%s_DEFINED\n", c_name);
|
||||||
fprintf(header, "#define RUNTIMECLASS_%s_DEFINED\n", c_name);
|
fprintf(header, "#define RUNTIMECLASS_%s_DEFINED\n", c_name);
|
||||||
|
fprintf(header, "#if defined(_MSC_VER) || defined(__MINGW32__)\n");
|
||||||
|
/* FIXME: MIDL generates extern const here but GCC warns if extern is initialized */
|
||||||
|
fprintf(header, "const DECLSPEC_SELECTANY WCHAR RuntimeClass_%s[] = L\"%s\";\n", c_name, name);
|
||||||
|
fprintf(header, "#else\n");
|
||||||
|
fprintf(header, "static const WCHAR RuntimeClass_%s[] = {", c_name);
|
||||||
|
for (i = 0, len = strlen(name); i < len; ++i) fprintf(header, "'%c',", name[i]);
|
||||||
|
fprintf(header, "0};\n");
|
||||||
|
fprintf(header, "#endif\n");
|
||||||
fprintf(header, "#endif /* RUNTIMECLASS_%s_DEFINED */\n", c_name);
|
fprintf(header, "#endif /* RUNTIMECLASS_%s_DEFINED */\n", c_name);
|
||||||
free(c_name);
|
free(c_name);
|
||||||
free(name);
|
free(name);
|
||||||
|
|
Loading…
Reference in New Issue