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
451d5043
Commit
451d5043
authored
Aug 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add int64, int128 and float argument types.
parent
e0188c83
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
8 deletions
+46
-8
build.h
tools/winebuild/build.h
+4
-1
parser.c
tools/winebuild/parser.c
+3
-0
spec16.c
tools/winebuild/spec16.c
+15
-3
spec32.c
tools/winebuild/spec32.c
+2
-0
utils.c
tools/winebuild/utils.c
+9
-0
winebuild.man.in
tools/winebuild/winebuild.man.in
+13
-4
No files found.
tools/winebuild/build.h
View file @
451d5043
...
...
@@ -68,7 +68,10 @@ enum arg_type
ARG_PTR
,
/* pointer */
ARG_STR
,
/* pointer to Ansi string */
ARG_WSTR
,
/* pointer to Unicode string */
ARG_DOUBLE
,
/* floating point double */
ARG_INT64
,
/* 64-bit integer */
ARG_INT128
,
/* 128-bit integer */
ARG_FLOAT
,
/* 32-bit float */
ARG_DOUBLE
,
/* 64-bit float */
ARG_MAXARG
=
ARG_DOUBLE
};
...
...
tools/winebuild/parser.c
View file @
451d5043
...
...
@@ -82,6 +82,9 @@ static const char * const ArgNames[ARG_MAXARG + 1] =
"ptr"
,
/* ARG_PTR */
"str"
,
/* ARG_STR */
"wstr"
,
/* ARG_WSTR */
"int64"
,
/* ARG_INT64 */
"int128"
,
/* ARG_INT128 */
"float"
,
/* ARG_FLOAT */
"double"
/* ARG_DOUBLE */
};
...
...
tools/winebuild/spec16.c
View file @
451d5043
...
...
@@ -78,11 +78,14 @@ static const char *get_args_str( const ORDDEF *odp )
case
ARG_SWORD
:
strcat
(
buffer
,
"s"
);
break
;
case
ARG_SEGSTR
:
strcat
(
buffer
,
"T"
);
break
;
case
ARG_STR
:
strcat
(
buffer
,
"t"
);
break
;
case
ARG_DOUBLE
:
strcat
(
buffer
,
"ll"
);
break
;
case
ARG_LONG
:
case
ARG_FLOAT
:
case
ARG_SEGPTR
:
strcat
(
buffer
,
"l"
);
break
;
case
ARG_PTR
:
case
ARG_WSTR
:
strcat
(
buffer
,
"p"
);
break
;
case
ARG_WSTR
:
case
ARG_INT128
:
strcat
(
buffer
,
"p"
);
break
;
case
ARG_INT64
:
case
ARG_DOUBLE
:
strcat
(
buffer
,
"ll"
);
break
;
}
}
return
buffer
;
...
...
@@ -288,8 +291,11 @@ static int get_function_argsize( const ORDDEF *odp )
case
ARG_PTR
:
case
ARG_STR
:
case
ARG_WSTR
:
case
ARG_FLOAT
:
case
ARG_INT128
:
argsize
+=
4
;
break
;
case
ARG_INT64
:
case
ARG_DOUBLE
:
argsize
+=
8
;
break
;
...
...
@@ -362,7 +368,7 @@ static void output_call16_function( ORDDEF *odp )
/* preserve 16-byte stack alignment */
stack_words
+=
odp
->
u
.
func
.
nb_args
;
for
(
i
=
0
;
i
<
odp
->
u
.
func
.
nb_args
;
i
++
)
if
(
odp
->
u
.
func
.
args
[
i
]
==
ARG_DOUBLE
)
stack_words
++
;
if
(
odp
->
u
.
func
.
args
[
i
]
==
ARG_DOUBLE
||
odp
->
u
.
func
.
args
[
i
]
==
ARG_INT64
)
stack_words
++
;
if
((
odp
->
flags
&
FLAG_REGISTER
)
||
(
odp
->
type
==
TYPE_VARARGS
))
stack_words
++
;
if
(
stack_words
%
4
)
output
(
"
\t
subl $%d,%%esp
\n
"
,
16
-
4
*
(
stack_words
%
4
)
);
...
...
@@ -398,12 +404,14 @@ static void output_call16_function( ORDDEF *odp )
if
(
odp
->
type
==
TYPE_PASCAL
)
pos
+=
2
;
break
;
case
ARG_INT64
:
case
ARG_DOUBLE
:
if
(
odp
->
type
!=
TYPE_PASCAL
)
pos
-=
4
;
output
(
"
\t
pushl %d(%%ecx)
\n
"
,
pos
);
if
(
odp
->
type
==
TYPE_PASCAL
)
pos
+=
4
;
/* fall through */
case
ARG_LONG
:
case
ARG_FLOAT
:
case
ARG_SEGPTR
:
case
ARG_SEGSTR
:
if
(
odp
->
type
!=
TYPE_PASCAL
)
pos
-=
4
;
...
...
@@ -414,6 +422,7 @@ static void output_call16_function( ORDDEF *odp )
case
ARG_PTR
:
case
ARG_STR
:
case
ARG_WSTR
:
case
ARG_INT128
:
if
(
odp
->
type
!=
TYPE_PASCAL
)
pos
-=
4
;
output
(
"
\t
movzwl %d(%%ecx),%%edx
\n
"
,
pos
+
2
);
/* sel */
output
(
"
\t
shr $3,%%edx
\n
"
);
...
...
@@ -707,6 +716,9 @@ static void output_module16( DLLSPEC *spec )
case
ARG_PTR
:
type
=
ARG16_PTR
;
break
;
case
ARG_STR
:
type
=
ARG16_STR
;
break
;
case
ARG_WSTR
:
type
=
ARG16_PTR
;
break
;
case
ARG_FLOAT
:
type
=
ARG16_LONG
;
break
;
case
ARG_INT128
:
type
=
ARG16_PTR
;
break
;
case
ARG_INT64
:
case
ARG_DOUBLE
:
type
=
ARG16_LONG
;
arg_types
[
pos
/
10
]
|=
type
<<
(
3
*
(
pos
%
10
));
...
...
tools/winebuild/spec32.c
View file @
451d5043
...
...
@@ -117,7 +117,9 @@ static void output_relay_debug( DLLSPEC *spec )
{
case
ARG_STR
:
mask
|=
1
<<
(
2
*
pos
++
);
break
;
case
ARG_WSTR
:
mask
|=
2
<<
(
2
*
pos
++
);
break
;
case
ARG_INT64
:
case
ARG_DOUBLE
:
pos
+=
8
/
get_ptr_size
();
break
;
case
ARG_INT128
:
pos
+=
(
target_cpu
==
CPU_x86
)
?
4
:
1
;
break
;
default:
pos
++
;
break
;
}
}
...
...
tools/winebuild/utils.c
View file @
451d5043
...
...
@@ -899,9 +899,18 @@ unsigned int get_args_size( const ORDDEF *odp )
{
switch
(
odp
->
u
.
func
.
args
[
i
])
{
case
ARG_INT64
:
case
ARG_DOUBLE
:
size
+=
8
;
break
;
case
ARG_INT128
:
/* int128 is passed as pointer on x86_64 */
if
(
target_cpu
!=
CPU_x86_64
)
{
size
+=
16
;
break
;
}
/* fall through */
default:
size
+=
get_ptr_size
();
break
;
...
...
tools/winebuild/winebuild.man.in
View file @
451d5043
...
...
@@ -343,10 +343,19 @@ should be one or several of:
(16-bit signed word)
.TP
.B long
(32-bit value)
(pointer-sized integer value)
.TP
.B int64
(64-bit integer value)
.TP
.B int128
(128-bit integer value)
.TP
.B float
(32-bit floating point value)
.TP
.B double
(64-bit value)
(64-bit
floating point
value)
.TP
.B ptr
(linear pointer)
...
...
@@ -363,8 +372,8 @@ should be one or several of:
.B segstr
(segmented pointer to a null-terminated ASCII string).
.HP
.RB Only\ ptr ,\ str ,\ wstr ,\ long\ and\ double
are valid for Win32
functions.
Note: The 16-bit and segmented pointer types are only valid for Win16
functions.
.RE
.PP
.I handler
...
...
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