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
21740b5e
Commit
21740b5e
authored
Aug 05, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Added support for -ns_prefix option.
parent
3f606a59
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
4 deletions
+35
-4
windows.foundation.idl
include/windows.foundation.idl
+1
-1
header.c
tools/widl/header.c
+8
-2
parser.l
tools/widl/parser.l
+7
-0
typetree.c
tools/widl/typetree.c
+9
-1
widl.c
tools/widl/widl.c
+7
-0
widl.h
tools/widl/widl.h
+1
-0
widl.man.in
tools/widl/widl.man.in
+2
-0
No files found.
include/windows.foundation.idl
View file @
21740b5e
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*/
*/
#
ifdef
__WIDL__
#
ifdef
__WIDL__
#
pragma
winrt
#
pragma
winrt
ns_prefix
#
endif
#
endif
import
"inspectable.idl"
;
import
"inspectable.idl"
;
...
...
tools/widl/header.c
View file @
21740b5e
...
@@ -155,8 +155,11 @@ static const char *uuid_string(const UUID *uuid)
...
@@ -155,8 +155,11 @@ static const char *uuid_string(const UUID *uuid)
static
void
write_namespace_start
(
FILE
*
header
,
struct
namespace
*
namespace
)
static
void
write_namespace_start
(
FILE
*
header
,
struct
namespace
*
namespace
)
{
{
if
(
is_global_namespace
(
namespace
))
if
(
is_global_namespace
(
namespace
))
{
if
(
use_abi_namespace
)
write_line
(
header
,
1
,
"namespace ABI {"
);
return
;
return
;
}
write_namespace_start
(
header
,
namespace
->
parent
);
write_namespace_start
(
header
,
namespace
->
parent
);
write_line
(
header
,
1
,
"namespace %s {"
,
namespace
->
name
);
write_line
(
header
,
1
,
"namespace %s {"
,
namespace
->
name
);
...
@@ -164,8 +167,11 @@ static void write_namespace_start(FILE *header, struct namespace *namespace)
...
@@ -164,8 +167,11 @@ static void write_namespace_start(FILE *header, struct namespace *namespace)
static
void
write_namespace_end
(
FILE
*
header
,
struct
namespace
*
namespace
)
static
void
write_namespace_end
(
FILE
*
header
,
struct
namespace
*
namespace
)
{
{
if
(
is_global_namespace
(
namespace
))
if
(
is_global_namespace
(
namespace
))
{
if
(
use_abi_namespace
)
write_line
(
header
,
-
1
,
"}"
,
namespace
->
name
);
return
;
return
;
}
write_line
(
header
,
-
1
,
"}"
,
namespace
->
name
);
write_line
(
header
,
-
1
,
"}"
,
namespace
->
name
);
write_namespace_end
(
header
,
namespace
->
parent
);
write_namespace_end
(
header
,
namespace
->
parent
);
...
...
tools/widl/parser.l
View file @
21740b5e
...
@@ -152,7 +152,14 @@ UUID *parse_uuid(const char *u)
...
@@ -152,7 +152,14 @@ UUID *parse_uuid(const char *u)
if(!winrt_mode)
if(!winrt_mode)
error_loc("winrt IDL file imported in non-winrt mode\n");
error_loc("winrt IDL file imported in non-winrt mode\n");
}else {
}else {
const char *ptr = yytext+5;
winrt_mode = TRUE;
winrt_mode = TRUE;
while(isspace(*ptr))
ptr++;
if(!strncmp(ptr, "ns_prefix", 9) && (!*(ptr += 9) || isspace(*ptr)))
use_abi_namespace = TRUE;
}
}
yy_pop_state();
yy_pop_state();
}
}
...
...
tools/widl/typetree.c
View file @
21740b5e
...
@@ -80,8 +80,13 @@ static const var_t *find_arg(const var_list_t *args, const char *name)
...
@@ -80,8 +80,13 @@ static const var_t *find_arg(const var_list_t *args, const char *name)
static
char
*
append_namespace
(
char
*
ptr
,
struct
namespace
*
namespace
,
const
char
*
separator
)
static
char
*
append_namespace
(
char
*
ptr
,
struct
namespace
*
namespace
,
const
char
*
separator
)
{
{
if
(
is_global_namespace
(
namespace
))
if
(
is_global_namespace
(
namespace
))
{
if
(
!
use_abi_namespace
)
return
ptr
;
return
ptr
;
strcpy
(
ptr
,
"ABI"
);
strcat
(
ptr
,
separator
);
return
ptr
+
strlen
(
ptr
);
}
ptr
=
append_namespace
(
ptr
,
namespace
->
parent
,
separator
);
ptr
=
append_namespace
(
ptr
,
namespace
->
parent
,
separator
);
strcpy
(
ptr
,
namespace
->
name
);
strcpy
(
ptr
,
namespace
->
name
);
...
@@ -96,6 +101,9 @@ char *format_namespace(struct namespace *namespace, const char *prefix, const ch
...
@@ -96,6 +101,9 @@ char *format_namespace(struct namespace *namespace, const char *prefix, const ch
struct
namespace
*
iter
;
struct
namespace
*
iter
;
char
*
ret
,
*
ptr
;
char
*
ret
,
*
ptr
;
if
(
use_abi_namespace
&&
!
is_global_namespace
(
namespace
))
len
+=
3
/* strlen("ABI") */
+
sep_len
;
for
(
iter
=
namespace
;
!
is_global_namespace
(
iter
);
iter
=
iter
->
parent
)
for
(
iter
=
namespace
;
!
is_global_namespace
(
iter
);
iter
=
iter
->
parent
)
len
+=
strlen
(
iter
->
name
)
+
sep_len
;
len
+=
strlen
(
iter
->
name
)
+
sep_len
;
...
...
tools/widl/widl.c
View file @
21740b5e
...
@@ -73,6 +73,7 @@ static const char usage[] =
...
@@ -73,6 +73,7 @@ static const char usage[] =
" --prefix-server=p Prefix names of server functions with 'p'
\n
"
" --prefix-server=p Prefix names of server functions with 'p'
\n
"
" -r Generate registration script
\n
"
" -r Generate registration script
\n
"
" --winrt Enable Windows Runtime mode
\n
"
" --winrt Enable Windows Runtime mode
\n
"
" --ns_prefix Prefix namespaces with ABI namespace
\n
"
" -s Generate server stub
\n
"
" -s Generate server stub
\n
"
" -t Generate typelib
\n
"
" -t Generate typelib
\n
"
" -u Generate interface identifiers file
\n
"
" -u Generate interface identifiers file
\n
"
...
@@ -115,6 +116,7 @@ int do_win64 = 1;
...
@@ -115,6 +116,7 @@ int do_win64 = 1;
int
win32_packing
=
8
;
int
win32_packing
=
8
;
int
win64_packing
=
8
;
int
win64_packing
=
8
;
int
winrt_mode
=
0
;
int
winrt_mode
=
0
;
int
use_abi_namespace
=
0
;
static
enum
stub_mode
stub_mode
=
MODE_Os
;
static
enum
stub_mode
stub_mode
=
MODE_Os
;
char
*
input_name
;
char
*
input_name
;
...
@@ -155,6 +157,7 @@ enum {
...
@@ -155,6 +157,7 @@ enum {
PREFIX_CLIENT_OPTION
,
PREFIX_CLIENT_OPTION
,
PREFIX_SERVER_OPTION
,
PREFIX_SERVER_OPTION
,
PRINT_HELP
,
PRINT_HELP
,
RT_NS_PREFIX
,
RT_OPTION
,
RT_OPTION
,
WIN32_OPTION
,
WIN32_OPTION
,
WIN64_OPTION
,
WIN64_OPTION
,
...
@@ -170,6 +173,7 @@ static const struct option long_options[] = {
...
@@ -170,6 +173,7 @@ static const struct option long_options[] = {
{
"dlldata-only"
,
0
,
NULL
,
DLLDATA_ONLY_OPTION
},
{
"dlldata-only"
,
0
,
NULL
,
DLLDATA_ONLY_OPTION
},
{
"help"
,
0
,
NULL
,
PRINT_HELP
},
{
"help"
,
0
,
NULL
,
PRINT_HELP
},
{
"local-stubs"
,
1
,
NULL
,
LOCAL_STUBS_OPTION
},
{
"local-stubs"
,
1
,
NULL
,
LOCAL_STUBS_OPTION
},
{
"ns_prefix"
,
0
,
NULL
,
RT_NS_PREFIX
},
{
"oldnames"
,
0
,
NULL
,
OLDNAMES_OPTION
},
{
"oldnames"
,
0
,
NULL
,
OLDNAMES_OPTION
},
{
"output"
,
0
,
NULL
,
'o'
},
{
"output"
,
0
,
NULL
,
'o'
},
{
"prefix-all"
,
1
,
NULL
,
PREFIX_ALL_OPTION
},
{
"prefix-all"
,
1
,
NULL
,
PREFIX_ALL_OPTION
},
...
@@ -580,6 +584,9 @@ int main(int argc,char *argv[])
...
@@ -580,6 +584,9 @@ int main(int argc,char *argv[])
case
RT_OPTION
:
case
RT_OPTION
:
winrt_mode
=
1
;
winrt_mode
=
1
;
break
;
break
;
case
RT_NS_PREFIX
:
use_abi_namespace
=
1
;
break
;
case
WIN32_OPTION
:
case
WIN32_OPTION
:
do_win32
=
1
;
do_win32
=
1
;
do_win64
=
0
;
do_win64
=
0
;
...
...
tools/widl/widl.h
View file @
21740b5e
...
@@ -50,6 +50,7 @@ extern int do_win64;
...
@@ -50,6 +50,7 @@ extern int do_win64;
extern
int
win32_packing
;
extern
int
win32_packing
;
extern
int
win64_packing
;
extern
int
win64_packing
;
extern
int
winrt_mode
;
extern
int
winrt_mode
;
extern
int
use_abi_namespace
;
extern
char
*
input_name
;
extern
char
*
input_name
;
extern
char
*
input_idl_name
;
extern
char
*
input_idl_name
;
...
...
tools/widl/widl.man.in
View file @
21740b5e
...
@@ -85,6 +85,8 @@ file).
...
@@ -85,6 +85,8 @@ file).
.PP
.PP
.IP "\fB--winrt\fR"
.IP "\fB--winrt\fR"
Enable Windows Runtime mode.
Enable Windows Runtime mode.
.IP "\fB--ns_prefix\fR"
Prefix namespaces with ABI namespace.
.PP
.PP
.B Registration script options:
.B Registration script options:
.IP "\fB-r\fR"
.IP "\fB-r\fR"
...
...
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