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
e50866ae
Commit
e50866ae
authored
Jul 31, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Write proper C++ forward declarations for interfaces inside namespace.
parent
867b0f82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
header.c
tools/widl/header.c
+34
-1
No files found.
tools/widl/header.c
View file @
e50866ae
...
...
@@ -52,6 +52,16 @@ static void indent(FILE *h, int delta)
if
(
delta
>
0
)
indentation
+=
delta
;
}
static
void
write_line
(
FILE
*
f
,
int
delta
,
const
char
*
fmt
,
...)
{
va_list
ap
;
indent
(
f
,
delta
);
va_start
(
ap
,
fmt
);
vfprintf
(
f
,
fmt
,
ap
);
va_end
(
ap
);
fprintf
(
f
,
"
\n
"
);
}
int
is_ptrchain_attr
(
const
var_t
*
var
,
enum
attr_type
t
)
{
if
(
is_attr
(
var
->
attrs
,
t
))
...
...
@@ -141,6 +151,24 @@ static const char *uuid_string(const UUID *uuid)
return
buf
;
}
static
void
write_namespace_start
(
FILE
*
header
,
struct
namespace
*
namespace
)
{
if
(
is_global_namespace
(
namespace
))
return
;
write_namespace_start
(
header
,
namespace
->
parent
);
write_line
(
header
,
1
,
"namespace %s {"
,
namespace
->
name
);
}
static
void
write_namespace_end
(
FILE
*
header
,
struct
namespace
*
namespace
)
{
if
(
is_global_namespace
(
namespace
))
return
;
write_line
(
header
,
-
1
,
"}"
,
namespace
->
name
);
write_namespace_end
(
header
,
namespace
->
parent
);
}
const
char
*
get_name
(
const
var_t
*
v
)
{
static
char
buffer
[
256
];
...
...
@@ -1221,7 +1249,12 @@ static void write_forward(FILE *header, type_t *iface)
{
fprintf
(
header
,
"#ifndef __%s_FWD_DEFINED__
\n
"
,
iface
->
c_name
);
fprintf
(
header
,
"#define __%s_FWD_DEFINED__
\n
"
,
iface
->
c_name
);
fprintf
(
header
,
"typedef interface %s %s;
\n
"
,
iface
->
name
,
iface
->
name
);
fprintf
(
header
,
"typedef interface %s %s;
\n
"
,
iface
->
c_name
,
iface
->
c_name
);
fprintf
(
header
,
"#ifdef __cplusplus
\n
"
);
write_namespace_start
(
header
,
iface
->
namespace
);
write_line
(
header
,
0
,
"interface %s;"
,
iface
->
name
);
write_namespace_end
(
header
,
iface
->
namespace
);
fprintf
(
header
,
"#endif /* __cplusplus */
\n
"
);
fprintf
(
header
,
"#endif
\n\n
"
);
}
...
...
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