Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
59cfad37
Commit
59cfad37
authored
Aug 29, 2006
by
Dan Hipschman
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Generate names for tagless structs, unions and enums.
parent
ada61620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
parser.y
tools/widl/parser.y
+36
-0
No files found.
tools/widl/parser.y
View file @
59cfad37
...
...
@@ -104,6 +104,7 @@ static void write_diid(type_t *iface);
static void write_iid(type_t *iface);
static int compute_method_indexes(type_t *iface);
static char *gen_name(void);
#define tsENUM 1
#define tsSTRUCT 2
...
...
@@ -824,9 +825,19 @@ type: tVOID { $$ = make_tref(NULL, make_type(0, NULL)); }
;
typedef: tTYPEDEF m_attributes type pident_list { typeref_t *tref = uniq_tref($3);
type_t *t;
$4->tname = tref->name;
tref->name = NULL;
$$ = type_ref(tref);
t = $$->ref;
if ((t->kind == TKIND_ENUM || t->kind == TKIND_RECORD
|| t->kind == TKIND_UNION) && ! t->name && ! parse_only)
{
attr_t *a = make_attr(ATTR_PUBLIC);
LINK(a, $2);
$2 = a;
t->name = gen_name();
}
$$->attrs = $2;
if (!parse_only && do_header)
write_typedef($$, $4);
...
...
@@ -1614,3 +1625,28 @@ static int compute_method_indexes(type_t *iface)
return idx;
}
static char *gen_name(void)
{
static const char format[] = "__WIDL_%s_generated_name_%08lX";
static unsigned long n = 0;
static const char *file_id;
static size_t size;
char *name;
if (! file_id)
{
char *dst = dup_basename(input_name, ".idl");
file_id = dst;
for (; *dst; ++dst)
if (! isalnum((unsigned char) *dst))
*dst = '_';
size = sizeof format - 7 + strlen(file_id) + 8;
}
name = xmalloc(size);
sprintf(name, format, file_id, n++);
return name;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment