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
53626dbd
Commit
53626dbd
authored
Dec 26, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add support for generating 32-bit and/or 64-bit code for proxies/clients/servers.
parent
b1ab7d88
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
39 deletions
+117
-39
client.c
tools/widl/client.c
+35
-13
parser.y
tools/widl/parser.y
+7
-0
proxy.c
tools/widl/proxy.c
+37
-13
server.c
tools/widl/server.c
+35
-13
typegen.c
tools/widl/typegen.c
+2
-0
widltypes.h
tools/widl/widltypes.h
+1
-0
No files found.
tools/widl/client.c
View file @
53626dbd
...
...
@@ -483,7 +483,7 @@ static void write_client_ifaces(const statement_list_t *stmts, int expr_eval_rou
write_stubdescdecl
(
iface
);
write_function_stubs
(
iface
,
proc_offset
);
print_client
(
"#if !defined(__RPC_WIN
32__)
\n
"
);
print_client
(
"#if !defined(__RPC_WIN
%u__)
\n
"
,
pointer_size
==
8
?
64
:
32
);
print_client
(
"#error Invalid build platform for this stub.
\n
"
);
print_client
(
"#endif
\n
"
);
...
...
@@ -496,22 +496,11 @@ static void write_client_ifaces(const statement_list_t *stmts, int expr_eval_rou
}
}
void
write_client
(
const
statement_list_t
*
stmts
)
static
void
write_client_routines
(
const
statement_list_t
*
stmts
)
{
unsigned
int
proc_offset
=
0
;
int
expr_eval_routines
;
if
(
!
do_client
)
return
;
if
(
do_everything
&&
!
need_stub_files
(
stmts
))
return
;
init_client
();
if
(
!
client
)
return
;
pointer_size
=
sizeof
(
void
*
);
write_formatstringsdecl
(
client
,
indent
,
stmts
,
need_stub
);
expr_eval_routines
=
write_expr_eval_routines
(
client
,
client_token
);
if
(
expr_eval_routines
)
...
...
@@ -524,6 +513,39 @@ void write_client(const statement_list_t *stmts)
write_procformatstring
(
client
,
stmts
,
need_stub
);
write_typeformatstring
(
client
,
stmts
,
need_stub
);
}
void
write_client
(
const
statement_list_t
*
stmts
)
{
if
(
!
do_client
)
return
;
if
(
do_everything
&&
!
need_stub_files
(
stmts
))
return
;
init_client
();
if
(
!
client
)
return
;
if
(
do_win32
&&
do_win64
)
{
fprintf
(
client
,
"
\n
#ifndef _WIN64
\n\n
"
);
pointer_size
=
4
;
write_client_routines
(
stmts
);
fprintf
(
client
,
"
\n
#else /* _WIN64 */
\n\n
"
);
pointer_size
=
8
;
write_client_routines
(
stmts
);
fprintf
(
client
,
"
\n
#endif /* _WIN64 */
\n
"
);
}
else
if
(
do_win32
)
{
pointer_size
=
4
;
write_client_routines
(
stmts
);
}
else
if
(
do_win64
)
{
pointer_size
=
8
;
write_client_routines
(
stmts
);
}
fclose
(
client
);
}
tools/widl/parser.y
View file @
53626dbd
...
...
@@ -1366,6 +1366,13 @@ void set_all_tfswrite(int val)
node->data.tfswrite = val;
}
void clear_all_offsets(void)
{
type_pool_node_t *node;
LIST_FOR_EACH_ENTRY(node, &type_pool, type_pool_node_t, link)
node->data.typestring_offset = node->data.ptrdesc = 0;
}
type_t *make_type(unsigned char type, type_t *ref)
{
type_t *t = alloc_type();
...
...
tools/widl/proxy.c
View file @
53626dbd
...
...
@@ -741,21 +741,10 @@ static type_t **sort_interfaces( const statement_list_t *stmts, int *count )
return
ifaces
;
}
void
write_proxi
es
(
const
statement_list_t
*
stmts
)
static
void
write_proxy_routin
es
(
const
statement_list_t
*
stmts
)
{
int
expr_eval_routines
;
char
*
file_id
=
proxy_token
;
int
i
,
count
,
have_baseiid
;
unsigned
int
proc_offset
=
0
;
type_t
**
interfaces
;
if
(
!
do_proxies
)
return
;
if
(
do_everything
&&
!
need_proxy_file
(
stmts
))
return
;
init_proxy
(
stmts
);
if
(
!
proxy
)
return
;
pointer_size
=
sizeof
(
void
*
);
write_formatstringsdecl
(
proxy
,
indent
,
stmts
,
need_proxy
);
write_stubdescproto
();
...
...
@@ -767,13 +756,48 @@ void write_proxies(const statement_list_t *stmts)
write_user_quad_list
(
proxy
);
write_stubdesc
(
expr_eval_routines
);
print_proxy
(
"#if !defined(__RPC_WIN
32__)
\n
"
);
print_proxy
(
"#if !defined(__RPC_WIN
%u__)
\n
"
,
pointer_size
==
8
?
64
:
32
);
print_proxy
(
"#error Currently only Wine and WIN32 are supported.
\n
"
);
print_proxy
(
"#endif
\n
"
);
print_proxy
(
"
\n
"
);
write_procformatstring
(
proxy
,
stmts
,
need_proxy
);
write_typeformatstring
(
proxy
,
stmts
,
need_proxy
);
}
void
write_proxies
(
const
statement_list_t
*
stmts
)
{
char
*
file_id
=
proxy_token
;
int
i
,
count
,
have_baseiid
;
type_t
**
interfaces
;
if
(
!
do_proxies
)
return
;
if
(
do_everything
&&
!
need_proxy_file
(
stmts
))
return
;
init_proxy
(
stmts
);
if
(
!
proxy
)
return
;
if
(
do_win32
&&
do_win64
)
{
fprintf
(
proxy
,
"
\n
#ifndef _WIN64
\n\n
"
);
pointer_size
=
4
;
write_proxy_routines
(
stmts
);
fprintf
(
proxy
,
"
\n
#else /* _WIN64 */
\n\n
"
);
pointer_size
=
8
;
write_proxy_routines
(
stmts
);
fprintf
(
proxy
,
"#endif /* _WIN64 */
\n\n
"
);
}
else
if
(
do_win32
)
{
pointer_size
=
4
;
write_proxy_routines
(
stmts
);
}
else
if
(
do_win64
)
{
pointer_size
=
8
;
write_proxy_routines
(
stmts
);
}
interfaces
=
sort_interfaces
(
stmts
,
&
count
);
fprintf
(
proxy
,
"static const CInterfaceProxyVtbl* const _%s_ProxyVtblList[] =
\n
"
,
file_id
);
fprintf
(
proxy
,
"{
\n
"
);
...
...
tools/widl/server.c
View file @
53626dbd
...
...
@@ -424,7 +424,7 @@ static void write_server_stmts(const statement_list_t *stmts, int expr_eval_rout
write_function_stubs
(
iface
,
proc_offset
);
print_server
(
"#if !defined(__RPC_WIN
32__)
\n
"
);
print_server
(
"#if !defined(__RPC_WIN
%u__)
\n
"
,
pointer_size
==
8
?
64
:
32
);
print_server
(
"#error Invalid build platform for this stub.
\n
"
);
print_server
(
"#endif
\n
"
);
...
...
@@ -436,22 +436,11 @@ static void write_server_stmts(const statement_list_t *stmts, int expr_eval_rout
}
}
void
write_server
(
const
statement_list_t
*
stmts
)
static
void
write_server_routines
(
const
statement_list_t
*
stmts
)
{
unsigned
int
proc_offset
=
0
;
int
expr_eval_routines
;
if
(
!
do_server
)
return
;
if
(
do_everything
&&
!
need_stub_files
(
stmts
))
return
;
init_server
();
if
(
!
server
)
return
;
pointer_size
=
sizeof
(
void
*
);
write_formatstringsdecl
(
server
,
indent
,
stmts
,
need_stub
);
expr_eval_routines
=
write_expr_eval_routines
(
server
,
server_token
);
if
(
expr_eval_routines
)
...
...
@@ -464,6 +453,39 @@ void write_server(const statement_list_t *stmts)
write_procformatstring
(
server
,
stmts
,
need_stub
);
write_typeformatstring
(
server
,
stmts
,
need_stub
);
}
void
write_server
(
const
statement_list_t
*
stmts
)
{
if
(
!
do_server
)
return
;
if
(
do_everything
&&
!
need_stub_files
(
stmts
))
return
;
init_server
();
if
(
!
server
)
return
;
if
(
do_win32
&&
do_win64
)
{
fprintf
(
server
,
"
\n
#ifndef _WIN64
\n\n
"
);
pointer_size
=
4
;
write_server_routines
(
stmts
);
fprintf
(
server
,
"
\n
#else /* _WIN64 */
\n\n
"
);
pointer_size
=
8
;
write_server_routines
(
stmts
);
fprintf
(
server
,
"
\n
#endif /* _WIN64 */
\n
"
);
}
else
if
(
do_win32
)
{
pointer_size
=
4
;
write_server_routines
(
stmts
);
}
else
if
(
do_win64
)
{
pointer_size
=
8
;
write_server_routines
(
stmts
);
}
fclose
(
server
);
}
tools/widl/typegen.c
View file @
53626dbd
...
...
@@ -572,6 +572,8 @@ static void write_formatdesc(FILE *f, int indent, const char *str)
void
write_formatstringsdecl
(
FILE
*
f
,
int
indent
,
const
statement_list_t
*
stmts
,
type_pred_t
pred
)
{
clear_all_offsets
();
print_file
(
f
,
indent
,
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
get_size_typeformatstring
(
stmts
,
pred
));
...
...
tools/widl/widltypes.h
View file @
53626dbd
...
...
@@ -396,6 +396,7 @@ void check_for_additional_prototype_types(const var_list_t *list);
void
init_types
(
void
);
type_t
*
alloc_type
(
void
);
void
set_all_tfswrite
(
int
val
);
void
clear_all_offsets
(
void
);
type_t
*
duptype
(
type_t
*
t
,
int
dupname
);
type_t
*
alias
(
type_t
*
t
,
const
char
*
name
);
...
...
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