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
8092e85e
Commit
8092e85e
authored
Jan 11, 2009
by
Michael Karcher
Committed by
Alexandre Julliard
Jan 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Fix handling of [local] functions without [call_as].
parent
110f2c2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
23 deletions
+28
-23
proxy.c
tools/widl/proxy.c
+28
-23
No files found.
tools/widl/proxy.c
View file @
8092e85e
...
...
@@ -543,6 +543,17 @@ static int count_methods(type_t *iface)
return
count
;
}
static
const
statement_t
*
get_callas_source
(
const
type_t
*
iface
,
const
var_t
*
def
)
{
const
statement_t
*
source
;
STATEMENTS_FOR_EACH_FUNC
(
source
,
type_iface_get_stmts
(
iface
))
{
const
var_t
*
cas
=
is_callas
(
source
->
u
.
var
->
attrs
);
if
(
cas
&&
!
strcmp
(
def
->
name
,
cas
->
name
))
return
source
;
}
return
NULL
;
}
static
int
write_proxy_methods
(
type_t
*
iface
,
int
skip
)
{
const
statement_t
*
stmt
;
...
...
@@ -554,8 +565,11 @@ static int write_proxy_methods(type_t *iface, int skip)
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
))
{
const
var_t
*
func
=
stmt
->
u
.
var
;
if
(
!
is_callas
(
func
->
attrs
))
{
if
(
i
!=
func
->
type
->
details
.
function
->
idx
)
error
(
"widl internal error: method index mismatch"
);
if
(
i
)
fprintf
(
proxy
,
",
\n
"
);
if
(
skip
)
print_proxy
(
"0 /* %s_%s_Proxy */"
,
iface
->
name
,
get_name
(
func
));
if
(
skip
||
(
is_local
(
func
->
attrs
)
&&
!
get_callas_source
(
iface
,
func
)))
print_proxy
(
"0 /* %s_%s_Proxy */"
,
iface
->
name
,
get_name
(
func
));
else
print_proxy
(
"%s_%s_Proxy"
,
iface
->
name
,
get_name
(
func
));
i
++
;
}
...
...
@@ -575,10 +589,19 @@ static int write_stub_methods(type_t *iface, int skip)
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
))
{
const
var_t
*
func
=
stmt
->
u
.
var
;
if
(
!
is_local
(
func
->
attrs
))
{
if
(
!
is_callas
(
func
->
attrs
))
{
int
missing
=
0
;
const
char
*
fname
=
get_name
(
func
);
if
(
is_local
(
func
->
attrs
))
{
const
statement_t
*
callas_source
=
get_callas_source
(
iface
,
func
);
if
(
!
callas_source
)
missing
=
1
;
else
fname
=
get_name
(
callas_source
->
u
.
var
);
}
if
(
i
)
fprintf
(
proxy
,
",
\n
"
);
if
(
skip
)
print_proxy
(
"STUB_FORWARDING_FUNCTION"
);
else
print_proxy
(
"%s_%s_Stub"
,
iface
->
name
,
get_name
(
func
)
);
if
(
skip
||
missing
)
print_proxy
(
"STUB_FORWARDING_FUNCTION"
);
else
print_proxy
(
"%s_%s_Stub"
,
iface
->
name
,
fname
);
i
++
;
}
}
...
...
@@ -587,7 +610,7 @@ static int write_stub_methods(type_t *iface, int skip)
static
void
write_proxy
(
type_t
*
iface
,
unsigned
int
*
proc_offset
)
{
int
midx
=
-
1
,
count
;
int
count
;
const
statement_t
*
stmt
;
int
first_func
=
1
;
...
...
@@ -619,28 +642,10 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
gen_proxy
(
iface
,
func
,
idx
,
*
proc_offset
);
gen_stub
(
iface
,
func
,
cname
,
*
proc_offset
);
*
proc_offset
+=
get_size_procformatstring_func
(
func
);
if
(
midx
==
-
1
)
midx
=
idx
;
else
if
(
midx
!=
idx
)
error
(
"method index mismatch in write_proxy
\n
"
);
midx
++
;
}
}
/* interface didn't have any methods - search in inherited interfaces */
if
(
midx
==
-
1
)
{
const
type_t
*
inherit_iface
;
for
(
inherit_iface
=
type_iface_get_inherit
(
iface
);
inherit_iface
;
inherit_iface
=
type_iface_get_inherit
(
inherit_iface
))
{
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
inherit_iface
))
{
const
var_t
*
func
=
stmt
->
u
.
var
;
int
idx
=
func
->
type
->
details
.
function
->
idx
;
if
(
idx
+
1
>
midx
)
midx
=
idx
+
1
;
}
}
}
count
=
count_methods
(
iface
);
if
(
midx
!=
-
1
&&
midx
!=
count
)
error
(
"invalid count %u/%u
\n
"
,
count
,
midx
);
/* proxy vtable */
print_proxy
(
"static const CINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =
\n
"
,
count
,
iface
->
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