Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
13592f0c
Commit
13592f0c
authored
Dec 01, 2020
by
Rémi Bernon
Committed by
Alexandre Julliard
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add abi_prefix parameter to format_namespace.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
495f24eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
header.c
tools/widl/header.c
+1
-1
parser.y
tools/widl/parser.y
+1
-1
typetree.c
tools/widl/typetree.c
+9
-9
widltypes.h
tools/widl/widltypes.h
+2
-1
No files found.
tools/widl/header.c
View file @
13592f0c
...
...
@@ -132,7 +132,7 @@ static void write_guid(FILE *f, const char *guid_prefix, const char *name, const
static
void
write_uuid_decl
(
FILE
*
f
,
type_t
*
type
,
const
UUID
*
uuid
)
{
char
*
name
=
format_namespace
(
type
->
namespace
,
""
,
"::"
,
type
->
name
);
char
*
name
=
format_namespace
(
type
->
namespace
,
""
,
"::"
,
type
->
name
,
use_abi_namespace
?
"ABI"
:
NULL
);
fprintf
(
f
,
"#ifdef __CRT_UUID_DECL
\n
"
);
fprintf
(
f
,
"__CRT_UUID_DECL(%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
"0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)
\n
"
,
...
...
tools/widl/parser.y
View file @
13592f0c
...
...
@@ -1922,7 +1922,7 @@ type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, in
if (is_global_namespace(namespace))
type->c_name = name;
else
type->c_name = format_namespace(namespace, "__x_", "_C", name);
type->c_name = format_namespace(namespace, "__x_", "_C", name
, use_abi_namespace ? "ABI" : NULL
);
nt->type = type;
nt->t = t;
nt->next = namespace->type_hash[hash];
...
...
tools/widl/typetree.c
View file @
13592f0c
...
...
@@ -89,38 +89,38 @@ const char *type_get_name(const type_t *type, enum name_type name_type)
return
NULL
;
}
static
char
*
append_namespace
(
char
*
ptr
,
struct
namespace
*
namespace
,
const
char
*
separator
)
static
char
*
append_namespace
(
char
*
ptr
,
struct
namespace
*
namespace
,
const
char
*
separator
,
const
char
*
abi_prefix
)
{
if
(
is_global_namespace
(
namespace
))
{
if
(
!
use_abi_namespace
)
return
ptr
;
strcpy
(
ptr
,
"ABI"
);
if
(
!
abi_prefix
)
return
ptr
;
strcpy
(
ptr
,
abi_prefix
);
strcat
(
ptr
,
separator
);
return
ptr
+
strlen
(
ptr
);
}
ptr
=
append_namespace
(
ptr
,
namespace
->
parent
,
separator
);
ptr
=
append_namespace
(
ptr
,
namespace
->
parent
,
separator
,
abi_prefix
);
strcpy
(
ptr
,
namespace
->
name
);
strcat
(
ptr
,
separator
);
return
ptr
+
strlen
(
ptr
);
}
char
*
format_namespace
(
struct
namespace
*
namespace
,
const
char
*
prefix
,
const
char
*
separator
,
const
char
*
suffix
)
char
*
format_namespace
(
struct
namespace
*
namespace
,
const
char
*
prefix
,
const
char
*
separator
,
const
char
*
suffix
,
const
char
*
abi_prefix
)
{
unsigned
len
=
strlen
(
prefix
)
+
strlen
(
suffix
);
unsigned
sep_len
=
strlen
(
separator
);
struct
namespace
*
iter
;
char
*
ret
,
*
ptr
;
if
(
use_abi_namespace
&&
!
is_global_namespace
(
namespace
)
)
len
+=
3
/* strlen("ABI") */
+
sep_len
;
if
(
abi_prefix
)
len
+=
strlen
(
abi_prefix
)
+
sep_len
;
for
(
iter
=
namespace
;
!
is_global_namespace
(
iter
);
iter
=
iter
->
parent
)
len
+=
strlen
(
iter
->
name
)
+
sep_len
;
ret
=
xmalloc
(
len
+
1
);
strcpy
(
ret
,
prefix
);
ptr
=
append_namespace
(
ret
+
strlen
(
ret
),
namespace
,
separator
);
ptr
=
append_namespace
(
ret
+
strlen
(
ret
),
namespace
,
separator
,
abi_prefix
);
strcpy
(
ptr
,
suffix
);
return
ret
;
...
...
tools/widl/widltypes.h
View file @
13592f0c
...
...
@@ -613,7 +613,8 @@ var_list_t *append_var(var_list_t *list, var_t *var);
void
init_loc_info
(
loc_info_t
*
);
char
*
format_namespace
(
struct
namespace
*
namespace
,
const
char
*
prefix
,
const
char
*
separator
,
const
char
*
suffix
);
char
*
format_namespace
(
struct
namespace
*
namespace
,
const
char
*
prefix
,
const
char
*
separator
,
const
char
*
suffix
,
const
char
*
abi_prefix
);
static
inline
enum
type_type
type_get_type_detect_alias
(
const
type_t
*
type
)
{
...
...
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