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
211ed7be
Commit
211ed7be
authored
Jun 09, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Fix packing of parameter structures for arguments larger than a pointer.
parent
59171bd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
typegen.c
tools/widl/typegen.c
+18
-2
No files found.
tools/widl/typegen.c
View file @
211ed7be
...
...
@@ -4667,7 +4667,16 @@ void write_func_param_struct( FILE *file, const type_t *iface, const type_t *fun
type_t
*
rettype
=
type_function_get_rettype
(
func
);
const
var_list_t
*
args
=
type_get_function_args
(
func
);
const
var_t
*
arg
;
int
needs_packing
;
unsigned
int
align
=
0
;
if
(
args
)
LIST_FOR_EACH_ENTRY
(
arg
,
args
,
const
var_t
,
entry
)
if
(
!
is_array
(
arg
->
type
))
type_memsize_and_alignment
(
arg
->
type
,
&
align
);
needs_packing
=
(
align
>
pointer_size
);
if
(
needs_packing
)
print_file
(
file
,
0
,
"#include <pshpack%u.h>
\n
"
,
pointer_size
);
print_file
(
file
,
1
,
"struct _PARAM_STRUCT
\n
"
);
print_file
(
file
,
1
,
"{
\n
"
);
if
(
is_object
(
iface
))
print_file
(
file
,
2
,
"%s *This;
\n
"
,
iface
->
name
);
...
...
@@ -4678,8 +4687,13 @@ void write_func_param_struct( FILE *file, const type_t *iface, const type_t *fun
write_type_left
(
file
,
(
type_t
*
)
arg
->
type
,
TRUE
);
if
(
needs_space_after
(
arg
->
type
))
fputc
(
' '
,
file
);
if
(
is_array
(
arg
->
type
)
&&
!
type_array_is_decl_as_ptr
(
arg
->
type
))
fputc
(
'*'
,
file
);
/* FIXME: should check for large args being passed by pointer */
if
(
is_array
(
arg
->
type
)
||
is_ptr
(
arg
->
type
)
||
type_memsize
(
arg
->
type
)
==
pointer_size
)
align
=
0
;
if
(
is_array
(
arg
->
type
)
||
is_ptr
(
arg
->
type
))
align
=
pointer_size
;
else
type_memsize_and_alignment
(
arg
->
type
,
&
align
);
if
(
align
>=
pointer_size
)
fprintf
(
file
,
"%s;
\n
"
,
arg
->
name
);
else
fprintf
(
file
,
"%s DECLSPEC_ALIGN(%u);
\n
"
,
arg
->
name
,
pointer_size
);
...
...
@@ -4693,7 +4707,9 @@ void write_func_param_struct( FILE *file, const type_t *iface, const type_t *fun
else
fprintf
(
file
,
" DECLSPEC_ALIGN(%u);
\n
"
,
pointer_size
);
}
print_file
(
file
,
1
,
"} %s;
\n\n
"
,
var_decl
);
print_file
(
file
,
1
,
"} %s;
\n
"
,
var_decl
);
if
(
needs_packing
)
print_file
(
file
,
0
,
"#include <poppack.h>
\n
"
);
print_file
(
file
,
0
,
"
\n
"
);
}
int
write_expr_eval_routines
(
FILE
*
file
,
const
char
*
iface
)
...
...
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