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
b1160407
Commit
b1160407
authored
Aug 24, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add support for specifying thiscall calling convention.
parent
d8cb2a0c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
0 deletions
+22
-0
build.h
tools/winebuild/build.h
+1
-0
import.c
tools/winebuild/import.c
+1
-0
parser.c
tools/winebuild/parser.c
+13
-0
spec32.c
tools/winebuild/spec32.c
+2
-0
winebuild.man.in
tools/winebuild/winebuild.man.in
+5
-0
No files found.
tools/winebuild/build.h
View file @
b1160407
...
...
@@ -47,6 +47,7 @@ typedef enum
TYPE_STDCALL
,
/* stdcall function (Win32) */
TYPE_CDECL
,
/* cdecl function (Win32) */
TYPE_VARARGS
,
/* varargs function (Win32) */
TYPE_THISCALL
,
/* thiscall function (Win32 on i386) */
TYPE_EXTERN
,
/* external symbol (Win32) */
TYPE_NBTYPES
}
ORD_TYPE
;
...
...
tools/winebuild/import.c
View file @
b1160407
...
...
@@ -457,6 +457,7 @@ static void check_undefined_exports( DLLSPEC *spec )
case
TYPE_STDCALL
:
case
TYPE_CDECL
:
case
TYPE_VARARGS
:
case
TYPE_THISCALL
:
if
(
link_ext_symbols
)
{
odp
->
flags
|=
FLAG_EXT_LINK
;
...
...
tools/winebuild/parser.c
View file @
b1160407
...
...
@@ -56,6 +56,7 @@ static const char * const TypeNames[TYPE_NBTYPES] =
"stdcall"
,
/* TYPE_STDCALL */
"cdecl"
,
/* TYPE_CDECL */
"varargs"
,
/* TYPE_VARARGS */
"thiscall"
,
/* TYPE_THISCALL */
"extern"
/* TYPE_EXTERN */
};
...
...
@@ -235,6 +236,11 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec )
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
"
);
...
...
@@ -325,6 +331,12 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec )
odp
->
flags
|=
FLAG_FORWARD
;
}
}
if
(
target_cpu
==
CPU_x86
&&
odp
->
type
==
TYPE_THISCALL
&&
!
(
odp
->
flags
&
FLAG_FORWARD
))
{
char
*
link_name
=
strmake
(
"__thiscall_%s"
,
odp
->
link_name
);
free
(
odp
->
link_name
);
odp
->
link_name
=
link_name
;
}
return
1
;
}
...
...
@@ -524,6 +536,7 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec )
case
TYPE_STDCALL
:
case
TYPE_VARARGS
:
case
TYPE_CDECL
:
case
TYPE_THISCALL
:
if
(
!
parse_spec_export
(
odp
,
spec
))
goto
error
;
break
;
case
TYPE_ABS
:
...
...
tools/winebuild/spec32.c
View file @
b1160407
...
...
@@ -246,6 +246,7 @@ void output_exports( DLLSPEC *spec )
case
TYPE_STDCALL
:
case
TYPE_VARARGS
:
case
TYPE_CDECL
:
case
TYPE_THISCALL
:
if
(
odp
->
flags
&
FLAG_FORWARD
)
{
output
(
"
\t
%s .L__wine_spec_forwards+%u
\n
"
,
get_asm_ptr_keyword
(),
fwd_size
);
...
...
@@ -816,6 +817,7 @@ void output_def_file( DLLSPEC *spec, int include_private )
/* fall through */
case
TYPE_VARARGS
:
case
TYPE_CDECL
:
case
TYPE_THISCALL
:
/* try to reduce output */
if
(
strcmp
(
name
,
odp
->
link_name
)
||
(
odp
->
flags
&
FLAG_FORWARD
))
output
(
"=%s"
,
odp
->
link_name
);
...
...
tools/winebuild/winebuild.man.in
View file @
b1160407
...
...
@@ -325,6 +325,11 @@ for a Win16 or Win32 function using the C calling convention
.B varargs
for a Win16 or Win32 function using the C calling convention with a
variable number of arguments
.TP
.B thiscall
for a Win32 function using the
.I thiscall
calling convention (first parameter in %ecx register on i386)
.RE
.PP
.I args
...
...
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