Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
0bc5e7a6
Commit
0bc5e7a6
authored
Jul 27, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Protect from duplicated method names in C-style vtable struct.
parent
6530e8a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
header.c
tools/widl/header.c
+26
-1
No files found.
tools/widl/header.c
View file @
0bc5e7a6
...
...
@@ -816,6 +816,28 @@ const var_t *is_callas(const attr_list_t *a)
return
get_attrp
(
a
,
ATTR_CALLAS
);
}
static
int
is_inherited_method
(
const
type_t
*
iface
,
const
var_t
*
func
)
{
while
((
iface
=
type_iface_get_inherit
(
iface
)))
{
const
statement_t
*
stmt
;
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
))
{
const
var_t
*
funccmp
=
stmt
->
u
.
var
;
if
(
!
is_callas
(
func
->
attrs
))
{
char
inherit_name
[
256
];
/* compare full name including property prefix */
strcpy
(
inherit_name
,
get_name
(
funccmp
));
if
(
!
strcmp
(
inherit_name
,
get_name
(
func
)))
return
1
;
}
}
}
return
0
;
}
static
void
write_method_macro
(
FILE
*
header
,
const
type_t
*
iface
,
const
char
*
name
)
{
const
statement_t
*
stmt
;
...
...
@@ -967,7 +989,10 @@ static void do_write_c_method_def(FILE *header, const type_t *iface, const char
if
(
!
callconv
)
callconv
=
"STDMETHODCALLTYPE"
;
indent
(
header
,
0
);
write_type_decl_left
(
header
,
type_function_get_rettype
(
func
->
type
));
fprintf
(
header
,
" (%s *%s)(
\n
"
,
callconv
,
get_name
(
func
));
if
(
is_inherited_method
(
iface
,
func
))
fprintf
(
header
,
" (%s *%s_%s)(
\n
"
,
callconv
,
iface
->
name
,
func
->
name
);
else
fprintf
(
header
,
" (%s *%s)(
\n
"
,
callconv
,
get_name
(
func
));
write_args
(
header
,
type_get_function_args
(
func
->
type
),
name
,
1
,
TRUE
);
fprintf
(
header
,
");
\n
"
);
fprintf
(
header
,
"
\n
"
);
...
...
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