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
0df819ee
Commit
0df819ee
authored
Jan 09, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Make identifiers file more compatible with midl.
parent
0d965c14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
header.c
tools/widl/header.c
+1
-1
header.h
tools/widl/header.h
+0
-2
widl.c
tools/widl/widl.c
+34
-4
No files found.
tools/widl/header.c
View file @
0df819ee
...
...
@@ -119,7 +119,7 @@ int is_conformant_array(const type_t *t)
return
is_array
(
t
)
&&
type_array_has_conformance
(
t
);
}
void
write_guid
(
FILE
*
f
,
const
char
*
guid_prefix
,
const
char
*
name
,
const
UUID
*
uuid
)
static
void
write_guid
(
FILE
*
f
,
const
char
*
guid_prefix
,
const
char
*
name
,
const
UUID
*
uuid
)
{
if
(
!
uuid
)
return
;
fprintf
(
f
,
"DEFINE_GUID(%s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
...
...
tools/widl/header.h
View file @
0df819ee
...
...
@@ -56,8 +56,6 @@ extern const type_t* get_explicit_generic_handle_type(const var_t* var);
extern
const
var_t
*
get_func_handle_var
(
const
type_t
*
iface
,
const
var_t
*
func
,
unsigned
char
*
explicit_fc
,
unsigned
char
*
implicit_fc
);
extern
int
has_out_arg_or_return
(
const
var_t
*
func
);
extern
void
write_guid
(
FILE
*
f
,
const
char
*
guid_prefix
,
const
char
*
name
,
const
UUID
*
uuid
);
extern
int
is_const_decl
(
const
var_t
*
var
);
static
inline
int
last_ptr
(
const
type_t
*
type
)
...
...
tools/widl/widl.c
View file @
0df819ee
...
...
@@ -446,6 +446,16 @@ void write_dlldata(const statement_list_t *stmts)
free_filename_nodes
(
&
filenames
);
}
static
void
write_id_guid
(
FILE
*
f
,
const
char
*
type
,
const
char
*
guid_prefix
,
const
char
*
name
,
const
UUID
*
uuid
)
{
if
(
!
uuid
)
return
;
fprintf
(
f
,
"MIDL_DEFINE_GUID(%s, %s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
"0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);
\n
"
,
type
,
guid_prefix
,
name
,
uuid
->
Data1
,
uuid
->
Data2
,
uuid
->
Data3
,
uuid
->
Data4
[
0
],
uuid
->
Data4
[
1
],
uuid
->
Data4
[
2
],
uuid
->
Data4
[
3
],
uuid
->
Data4
[
4
],
uuid
->
Data4
[
5
],
uuid
->
Data4
[
6
],
uuid
->
Data4
[
7
]);
}
static
void
write_id_data_stmts
(
const
statement_list_t
*
stmts
)
{
const
statement_t
*
stmt
;
...
...
@@ -460,19 +470,19 @@ static void write_id_data_stmts(const statement_list_t *stmts)
if
(
!
is_object
(
type
)
&&
!
is_attr
(
type
->
attrs
,
ATTR_DISPINTERFACE
))
continue
;
uuid
=
get_attrp
(
type
->
attrs
,
ATTR_UUID
);
write_
guid
(
idfile
,
is_attr
(
type
->
attrs
,
ATTR_DISPINTERFACE
)
?
"DIID"
:
"IID"
,
write_
id_guid
(
idfile
,
"IID"
,
is_attr
(
type
->
attrs
,
ATTR_DISPINTERFACE
)
?
"DIID"
:
"IID"
,
type
->
name
,
uuid
);
}
else
if
(
type_get_type
(
type
)
==
TYPE_COCLASS
)
{
const
UUID
*
uuid
=
get_attrp
(
type
->
attrs
,
ATTR_UUID
);
write_
guid
(
idfile
,
"CLSID"
,
type
->
name
,
uuid
);
write_
id_guid
(
idfile
,
"CLSID"
,
"CLSID"
,
type
->
name
,
uuid
);
}
}
else
if
(
stmt
->
type
==
STMT_LIBRARY
)
{
const
UUID
*
uuid
=
get_attrp
(
stmt
->
u
.
lib
->
attrs
,
ATTR_UUID
);
write_
guid
(
idfile
,
"LIBID"
,
stmt
->
u
.
lib
->
name
,
uuid
);
write_
id_guid
(
idfile
,
"IID"
,
"LIBID"
,
stmt
->
u
.
lib
->
name
,
uuid
);
write_id_data_stmts
(
stmt
->
u
.
lib
->
stmts
);
}
}
...
...
@@ -492,13 +502,33 @@ void write_id_data(const statement_list_t *stmts)
fprintf
(
idfile
,
"from %s - Do not edit ***/
\n\n
"
,
input_idl_name
);
fprintf
(
idfile
,
"#include <rpc.h>
\n
"
);
fprintf
(
idfile
,
"#include <rpcndr.h>
\n\n
"
);
fprintf
(
idfile
,
"#include <initguid.h>
\n\n
"
);
fprintf
(
idfile
,
"#ifdef _MIDL_USE_GUIDDEF_
\n\n
"
);
fprintf
(
idfile
,
"#ifndef INITGUID
\n
"
);
fprintf
(
idfile
,
"#define INITGUID
\n
"
);
fprintf
(
idfile
,
"#include <guiddef.h>
\n
"
);
fprintf
(
idfile
,
"#undef INITGUID
\n
"
);
fprintf
(
idfile
,
"#else
\n
"
);
fprintf
(
idfile
,
"#include <guiddef.h>
\n
"
);
fprintf
(
idfile
,
"#endif
\n\n
"
);
fprintf
(
idfile
,
"#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
\\\n
"
);
fprintf
(
idfile
,
" DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
\n\n
"
);
fprintf
(
idfile
,
"#else
\n\n
"
);
fprintf
(
idfile
,
"#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
\\\n
"
);
fprintf
(
idfile
,
" const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
\n\n
"
);
fprintf
(
idfile
,
"#endif
\n\n
"
);
start_cplusplus_guard
(
idfile
);
write_id_data_stmts
(
stmts
);
fprintf
(
idfile
,
"
\n
"
);
end_cplusplus_guard
(
idfile
);
fprintf
(
idfile
,
"#undef MIDL_DEFINE_GUID
\n
"
);
fclose
(
idfile
);
}
...
...
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