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
6b34eea6
Commit
6b34eea6
authored
Jul 26, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Added an extension that uses inline functions instead of macros for C interface calls.
parent
b06e8103
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
header.c
tools/widl/header.c
+41
-0
No files found.
tools/widl/header.c
View file @
6b34eea6
...
...
@@ -902,6 +902,43 @@ static void write_cpp_method_def(FILE *header, const type_t *iface)
}
}
static
void
write_inline_wrappers
(
FILE
*
header
,
const
type_t
*
iface
,
const
char
*
name
)
{
const
statement_t
*
stmt
;
int
first_iface
=
1
;
if
(
type_iface_get_inherit
(
iface
))
write_inline_wrappers
(
header
,
type_iface_get_inherit
(
iface
),
name
);
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
))
{
const
var_t
*
func
=
stmt
->
u
.
var
;
if
(
first_iface
)
{
fprintf
(
header
,
"/*** %s methods ***/
\n
"
,
iface
->
name
);
first_iface
=
0
;
}
if
(
!
is_callas
(
func
->
attrs
))
{
const
var_t
*
arg
;
fprintf
(
header
,
"static FORCEINLINE "
);
write_type_decl_left
(
header
,
type_function_get_rettype
(
func
->
type
));
fprintf
(
header
,
" %s_%s("
,
name
,
get_name
(
func
));
write_args
(
header
,
type_get_function_args
(
func
->
type
),
name
,
1
,
FALSE
);
fprintf
(
header
,
") {
\n
"
);
fprintf
(
header
,
" %s"
,
is_void
(
type_function_get_rettype
(
func
->
type
))
?
""
:
"return "
);
fprintf
(
header
,
"This->lpVtbl->%s(This"
,
get_name
(
func
));
if
(
type_get_function_args
(
func
->
type
))
LIST_FOR_EACH_ENTRY
(
arg
,
type_get_function_args
(
func
->
type
),
const
var_t
,
entry
)
fprintf
(
header
,
",%s"
,
arg
->
name
);
fprintf
(
header
,
");
\n
"
);
fprintf
(
header
,
"}
\n
"
);
}
}
}
static
void
do_write_c_method_def
(
FILE
*
header
,
const
type_t
*
iface
,
const
char
*
name
)
{
const
statement_t
*
stmt
;
...
...
@@ -1150,7 +1187,11 @@ static void write_com_interface_end(FILE *header, type_t *iface)
fprintf
(
header
,
"#ifdef COBJMACROS
\n
"
);
/* dispinterfaces don't have real functions, so don't write macros for them,
* only for the interface this interface inherits from, i.e. IDispatch */
fprintf
(
header
,
"#ifndef WIDL_C_INLINE_WRAPPERS
\n
"
);
write_method_macro
(
header
,
dispinterface
?
type_iface_get_inherit
(
iface
)
:
iface
,
iface
->
name
);
fprintf
(
header
,
"#else
\n
"
);
write_inline_wrappers
(
header
,
dispinterface
?
type_iface_get_inherit
(
iface
)
:
iface
,
iface
->
name
);
fprintf
(
header
,
"#endif
\n
"
);
fprintf
(
header
,
"#endif
\n
"
);
fprintf
(
header
,
"
\n
"
);
fprintf
(
header
,
"#endif
\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