Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
837297c2
Commit
837297c2
authored
Jun 25, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Support namespaces for union declarations.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
25e1fb45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
parser.y
tools/widl/parser.y
+3
-3
typetree.c
tools/widl/typetree.c
+5
-4
typetree.h
tools/widl/typetree.h
+1
-1
No files found.
tools/widl/parser.y
View file @
837297c2
...
@@ -477,7 +477,7 @@ typedecl:
...
@@ -477,7 +477,7 @@ typedecl:
| structdef
| structdef
| tSTRUCT aIDENTIFIER { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| tSTRUCT aIDENTIFIER { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| uniondef
| uniondef
| tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2, FALSE, NULL); }
| tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2,
current_namespace,
FALSE, NULL); }
| attributes enumdef { $$ = $2; $$->attrs = check_enum_attrs($1); }
| attributes enumdef { $$ = $2; $$->attrs = check_enum_attrs($1); }
| attributes structdef { $$ = $2; $$->attrs = check_struct_attrs($1); }
| attributes structdef { $$ = $2; $$->attrs = check_struct_attrs($1); }
| attributes uniondef { $$ = $2; $$->attrs = check_union_attrs($1); }
| attributes uniondef { $$ = $2; $$->attrs = check_union_attrs($1); }
...
@@ -1277,7 +1277,7 @@ unqualified_type:
...
@@ -1277,7 +1277,7 @@ unqualified_type:
| structdef { $$ = $1; }
| structdef { $$ = $1; }
| tSTRUCT aIDENTIFIER { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| tSTRUCT aIDENTIFIER { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| uniondef { $$ = $1; }
| uniondef { $$ = $1; }
| tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2, FALSE, NULL); }
| tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2,
current_namespace,
FALSE, NULL); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
| aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); }
| aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); }
;
;
...
@@ -1296,7 +1296,7 @@ typedef: m_attributes tTYPEDEF m_attributes decl_spec declarator_list
...
@@ -1296,7 +1296,7 @@ typedef: m_attributes tTYPEDEF m_attributes decl_spec declarator_list
;
;
uniondef: tUNION m_typename '{' ne_union_fields '}'
uniondef: tUNION m_typename '{' ne_union_fields '}'
{ $$ = type_new_nonencapsulated_union($2, TRUE, $4); }
{ $$ = type_new_nonencapsulated_union($2,
current_namespace,
TRUE, $4); }
| tUNION m_typename
| tUNION m_typename
tSWITCH '(' s_field ')'
tSWITCH '(' s_field ')'
m_ident '{' cases '}' { $$ = type_new_encapsulated_union($2, $5, $7, $9); }
m_ident '{' cases '}' { $$ = type_new_encapsulated_union($2, $5, $7, $9); }
...
...
tools/widl/typetree.c
View file @
837297c2
...
@@ -580,19 +580,20 @@ type_t *type_new_struct(char *name, struct namespace *namespace, int defined, va
...
@@ -580,19 +580,20 @@ type_t *type_new_struct(char *name, struct namespace *namespace, int defined, va
return
t
;
return
t
;
}
}
type_t
*
type_new_nonencapsulated_union
(
const
char
*
name
,
int
defined
,
var_list_t
*
fields
)
type_t
*
type_new_nonencapsulated_union
(
const
char
*
name
,
struct
namespace
*
namespace
,
int
defined
,
var_list_t
*
fields
)
{
{
type_t
*
t
=
NULL
;
type_t
*
t
=
NULL
;
if
(
name
)
if
(
name
)
t
=
find_type
(
name
,
NULL
,
tsUNION
);
t
=
find_type
(
name
,
namespace
,
tsUNION
);
if
(
!
t
)
if
(
!
t
)
{
{
t
=
make_type
(
TYPE_UNION
);
t
=
make_type
(
TYPE_UNION
);
t
->
name
=
name
;
t
->
name
=
name
;
t
->
namespace
=
namespace
;
if
(
name
)
if
(
name
)
reg_type
(
t
,
name
,
NULL
,
tsUNION
);
reg_type
(
t
,
name
,
namespace
,
tsUNION
);
}
}
if
(
!
t
->
defined
&&
defined
)
if
(
!
t
->
defined
&&
defined
)
...
@@ -627,7 +628,7 @@ type_t *type_new_encapsulated_union(char *name, var_t *switch_field, var_t *unio
...
@@ -627,7 +628,7 @@ type_t *type_new_encapsulated_union(char *name, var_t *switch_field, var_t *unio
{
{
if
(
!
union_field
)
if
(
!
union_field
)
union_field
=
make_var
(
xstrdup
(
"tagged_union"
));
union_field
=
make_var
(
xstrdup
(
"tagged_union"
));
union_field
->
declspec
.
type
=
type_new_nonencapsulated_union
(
gen_name
(),
TRUE
,
cases
);
union_field
->
declspec
.
type
=
type_new_nonencapsulated_union
(
gen_name
(),
NULL
,
TRUE
,
cases
);
t
->
details
.
structure
=
xmalloc
(
sizeof
(
*
t
->
details
.
structure
));
t
->
details
.
structure
=
xmalloc
(
sizeof
(
*
t
->
details
.
structure
));
t
->
details
.
structure
->
fields
=
append_var
(
NULL
,
switch_field
);
t
->
details
.
structure
->
fields
=
append_var
(
NULL
,
switch_field
);
...
...
tools/widl/typetree.h
View file @
837297c2
...
@@ -53,7 +53,7 @@ type_t *type_new_void(void);
...
@@ -53,7 +53,7 @@ type_t *type_new_void(void);
type_t
*
type_coclass_declare
(
char
*
name
);
type_t
*
type_coclass_declare
(
char
*
name
);
type_t
*
type_new_enum
(
const
char
*
name
,
struct
namespace
*
namespace
,
int
defined
,
var_list_t
*
enums
);
type_t
*
type_new_enum
(
const
char
*
name
,
struct
namespace
*
namespace
,
int
defined
,
var_list_t
*
enums
);
type_t
*
type_new_struct
(
char
*
name
,
struct
namespace
*
namespace
,
int
defined
,
var_list_t
*
fields
);
type_t
*
type_new_struct
(
char
*
name
,
struct
namespace
*
namespace
,
int
defined
,
var_list_t
*
fields
);
type_t
*
type_new_nonencapsulated_union
(
const
char
*
name
,
int
defined
,
var_list_t
*
fields
);
type_t
*
type_new_nonencapsulated_union
(
const
char
*
name
,
struct
namespace
*
namespace
,
int
defined
,
var_list_t
*
fields
);
type_t
*
type_new_encapsulated_union
(
char
*
name
,
var_t
*
switch_field
,
var_t
*
union_field
,
var_list_t
*
cases
);
type_t
*
type_new_encapsulated_union
(
char
*
name
,
var_t
*
switch_field
,
var_t
*
union_field
,
var_list_t
*
cases
);
type_t
*
type_new_bitfield
(
type_t
*
field_type
,
const
expr_t
*
bits
);
type_t
*
type_new_bitfield
(
type_t
*
field_type
,
const
expr_t
*
bits
);
type_t
*
type_runtimeclass_declare
(
char
*
name
,
struct
namespace
*
namespace
);
type_t
*
type_runtimeclass_declare
(
char
*
name
,
struct
namespace
*
namespace
);
...
...
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