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
2e6f48b7
Commit
2e6f48b7
authored
May 03, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Allow specifying arguments to stub functions for documentation purposes.
parent
5ac184ca
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
34 deletions
+52
-34
build.h
tools/winebuild/build.h
+1
-1
parser.c
tools/winebuild/parser.c
+43
-25
spec16.c
tools/winebuild/spec16.c
+2
-2
spec32.c
tools/winebuild/spec32.c
+3
-3
utils.c
tools/winebuild/utils.c
+1
-1
winebuild.man.in
tools/winebuild/winebuild.man.in
+2
-2
No files found.
tools/winebuild/build.h
View file @
2e6f48b7
...
...
@@ -85,7 +85,7 @@ typedef struct
typedef
struct
{
unsigned
int
nb_args
;
int
nb_args
;
enum
arg_type
args
[
MAX_ARGUMENTS
];
}
ORD_FUNCTION
;
...
...
tools/winebuild/parser.c
View file @
2e6f48b7
...
...
@@ -237,33 +237,17 @@ static int parse_spec_variable( ORDDEF *odp, DLLSPEC *spec )
/*******************************************************************
* parse_spec_
export
* parse_spec_
arguments
*
* Parse
an exported function definition in a .spec file
.
* Parse
the arguments of an entry point
.
*/
static
int
parse_spec_
export
(
ORDDEF
*
odp
,
DLLSPEC
*
spec
)
static
int
parse_spec_
arguments
(
ORDDEF
*
odp
,
DLLSPEC
*
spec
,
int
optional
)
{
const
char
*
token
;
unsigned
int
i
,
arg
;
int
is_win32
=
(
spec
->
type
==
SPEC_WIN32
)
||
(
odp
->
flags
&
FLAG_EXPORT32
);
if
(
!
is_win32
&&
odp
->
type
==
TYPE_STDCALL
)
{
error
(
"'stdcall' not supported for Win16
\n
"
);
return
0
;
}
if
(
!
is_win32
&&
odp
->
type
==
TYPE_THISCALL
)
{
error
(
"'thiscall' not supported for Win16
\n
"
);
return
0
;
}
if
(
is_win32
&&
odp
->
type
==
TYPE_PASCAL
)
{
error
(
"'pascal' not supported for Win32
\n
"
);
return
0
;
}
if
(
!
(
token
=
GetToken
(
0
)))
return
0
;
if
(
!
(
token
=
GetToken
(
optional
)))
return
optional
;
if
(
*
token
!=
'('
)
{
error
(
"Expected '(' got '%s'
\n
"
,
token
);
...
...
@@ -303,13 +287,45 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec )
}
odp
->
u
.
func
.
nb_args
=
i
;
if
(
odp
->
type
==
TYPE_VARARGS
)
odp
->
flags
|=
FLAG_NORELAY
;
/* no relay debug possible for varags entry point */
if
(
odp
->
type
==
TYPE_THISCALL
&&
(
!
i
||
odp
->
u
.
func
.
args
[
0
]
!=
ARG_PTR
))
{
error
(
"First argument of a thiscall function must be a pointer
\n
"
);
return
0
;
}
return
1
;
}
/*******************************************************************
* parse_spec_export
*
* Parse an exported function definition in a .spec file.
*/
static
int
parse_spec_export
(
ORDDEF
*
odp
,
DLLSPEC
*
spec
)
{
const
char
*
token
;
int
is_win32
=
(
spec
->
type
==
SPEC_WIN32
)
||
(
odp
->
flags
&
FLAG_EXPORT32
);
if
(
!
is_win32
&&
odp
->
type
==
TYPE_STDCALL
)
{
error
(
"'stdcall' not supported for Win16
\n
"
);
return
0
;
}
if
(
!
is_win32
&&
odp
->
type
==
TYPE_THISCALL
)
{
error
(
"'thiscall' not supported for Win16
\n
"
);
return
0
;
}
if
(
is_win32
&&
odp
->
type
==
TYPE_PASCAL
)
{
error
(
"'pascal' not supported for Win32
\n
"
);
return
0
;
}
if
(
!
parse_spec_arguments
(
odp
,
spec
,
0
))
return
0
;
if
(
odp
->
type
==
TYPE_VARARGS
)
odp
->
flags
|=
FLAG_NORELAY
;
/* no relay debug possible for varags entry point */
if
(
!
(
token
=
GetToken
(
1
)))
{
...
...
@@ -383,14 +399,15 @@ static int parse_spec_equate( ORDDEF *odp, DLLSPEC *spec )
*/
static
int
parse_spec_stub
(
ORDDEF
*
odp
,
DLLSPEC
*
spec
)
{
odp
->
u
.
func
.
nb_args
=
0
;
odp
->
u
.
func
.
nb_args
=
-
1
;
odp
->
link_name
=
xstrdup
(
""
);
/* don't bother generating stubs for Winelib */
if
(
odp
->
flags
&
FLAG_CPU_MASK
)
odp
->
flags
&=
FLAG_CPU
(
CPU_x86
)
|
FLAG_CPU
(
CPU_x86_64
);
else
odp
->
flags
|=
FLAG_CPU
(
CPU_x86
)
|
FLAG_CPU
(
CPU_x86_64
);
return
1
;
return
parse_spec_arguments
(
odp
,
spec
,
1
);
}
...
...
@@ -808,7 +825,8 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 )
odp
->
ordinal
=
-
1
;
odp
->
link_name
=
xstrdup
(
odp16
->
link_name
);
odp
->
u
.
func
.
nb_args
=
odp16
->
u
.
func
.
nb_args
;
memcpy
(
odp
->
u
.
func
.
args
,
odp16
->
u
.
func
.
args
,
odp
->
u
.
func
.
nb_args
*
sizeof
(
odp
->
u
.
func
.
args
[
0
])
);
if
(
odp
->
u
.
func
.
nb_args
>
0
)
memcpy
(
odp
->
u
.
func
.
args
,
odp16
->
u
.
func
.
args
,
odp
->
u
.
func
.
nb_args
*
sizeof
(
odp
->
u
.
func
.
args
[
0
])
);
}
assign_names
(
spec32
);
...
...
tools/winebuild/spec16.c
View file @
2e6f48b7
...
...
@@ -67,7 +67,7 @@ static inline int is_function( const ORDDEF *odp )
static
const
char
*
get_args_str
(
const
ORDDEF
*
odp
)
{
static
char
buffer
[
MAX_ARGUMENTS
*
2
+
1
];
unsigned
int
i
;
int
i
;
buffer
[
0
]
=
0
;
for
(
i
=
0
;
i
<
odp
->
u
.
func
.
nb_args
;
i
++
)
...
...
@@ -275,7 +275,7 @@ static const char *get_relay_name( const ORDDEF *odp )
*/
static
int
get_function_argsize
(
const
ORDDEF
*
odp
)
{
unsigned
int
i
,
argsize
=
0
;
int
i
,
argsize
=
0
;
for
(
i
=
0
;
i
<
odp
->
u
.
func
.
nb_args
;
i
++
)
{
...
...
tools/winebuild/spec32.c
View file @
2e6f48b7
...
...
@@ -61,7 +61,7 @@ static inline int needs_relay( const ORDDEF *odp )
return
1
;
}
static
int
is_float_arg
(
const
ORDDEF
*
odp
,
unsigned
int
arg
)
static
int
is_float_arg
(
const
ORDDEF
*
odp
,
int
arg
)
{
if
(
arg
>=
odp
->
u
.
func
.
nb_args
)
return
0
;
return
(
odp
->
u
.
func
.
args
[
arg
]
==
ARG_FLOAT
||
odp
->
u
.
func
.
args
[
arg
]
==
ARG_DOUBLE
);
...
...
@@ -89,8 +89,8 @@ int has_relays( DLLSPEC *spec )
*/
static
void
output_relay_debug
(
DLLSPEC
*
spec
)
{
int
i
;
unsigned
int
j
,
pos
,
args
,
flags
;
int
i
,
j
;
unsigned
int
pos
,
args
,
flags
;
/* first the table of entry point offsets */
...
...
tools/winebuild/utils.c
View file @
2e6f48b7
...
...
@@ -892,7 +892,7 @@ unsigned int get_ptr_size(void)
/* return the total size in bytes of the arguments on the stack */
unsigned
int
get_args_size
(
const
ORDDEF
*
odp
)
{
unsigned
int
i
,
size
;
int
i
,
size
;
for
(
i
=
size
=
0
;
i
<
odp
->
u
.
func
.
nb_args
;
i
++
)
{
...
...
tools/winebuild/winebuild.man.in
View file @
2e6f48b7
...
...
@@ -245,7 +245,7 @@ syntax is the following:
.RI [ flags ]\ exportname \ [ symbolname ]
.br
.IB ordinal\ stub
.RI [ flags ]\ exportname
.RI [ flags ]\ exportname
\ [\ \fB( args... \fB)\fR\ ]
.br
.IB ordinal\ equate
.RI [ flags ]\ exportname\ data
...
...
@@ -453,7 +453,7 @@ is not specified, it is assumed to be identical to
Syntax:
.br
.IB ordinal\ stub
.RI [ flags ]\ exportname
.RI [ flags ]\ exportname
\ [\ \fB( args... \fB)\fR\ ]
.PP
This declaration defines a stub function. It makes the name and
ordinal available for dynamic linking, but will terminate execution
...
...
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