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
8247686c
Commit
8247686c
authored
Feb 06, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmc: Set the output format from the output file name.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7b44224
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
9 deletions
+26
-9
makedep.c
tools/makedep.c
+6
-9
utils.c
tools/wmc/utils.c
+7
-0
utils.h
tools/wmc/utils.h
+1
-0
wmc.c
tools/wmc/wmc.c
+12
-0
No files found.
tools/makedep.c
View file @
8247686c
...
...
@@ -2757,11 +2757,15 @@ static void output_source_rc( struct makefile *make, struct incl_file *source, c
static
void
output_source_mc
(
struct
makefile
*
make
,
struct
incl_file
*
source
,
const
char
*
obj
)
{
unsigned
int
i
;
char
*
obj_path
=
obj_dir_path
(
make
,
obj
);
strarray_add
(
&
make
->
res_files
,
strmake
(
"%s.res"
,
obj
));
strarray_add
(
&
make
->
clean_files
,
strmake
(
"%s.pot"
,
obj
));
output
(
"%s.res: %s
\n
"
,
obj_dir_path
(
make
,
obj
),
source
->
filename
);
output
(
"
\t
%s -U -O res -o $@ %s"
,
tools_path
(
make
,
"wmc"
),
source
->
filename
);
output
(
"%s.pot %s.res: %s"
,
obj_path
,
obj_path
,
source
->
filename
);
output_filename
(
tools_path
(
make
,
"wmc"
));
output_filenames
(
source
->
dependencies
);
output
(
"
\n
"
);
output
(
"
\t
%s -u -o $@ %s"
,
tools_path
(
make
,
"wmc"
),
source
->
filename
);
if
(
linguas
.
count
)
{
char
*
po_dir
=
top_obj_dir_path
(
make
,
"po"
);
...
...
@@ -2772,13 +2776,6 @@ static void output_source_mc( struct makefile *make, struct incl_file *source, c
output_filename
(
strmake
(
"%s/%s.mo"
,
po_dir
,
linguas
.
str
[
i
]
));
}
output
(
"
\n
"
);
output
(
"%s.pot: %s
\n
"
,
obj_dir_path
(
make
,
obj
),
source
->
filename
);
output
(
"
\t
%s -O pot -o $@ %s"
,
tools_path
(
make
,
"wmc"
),
source
->
filename
);
output
(
"
\n
"
);
output
(
"%s.pot %s.res:"
,
obj_dir_path
(
make
,
obj
),
obj_dir_path
(
make
,
obj
));
output_filename
(
tools_path
(
make
,
"wmc"
));
output_filenames
(
source
->
dependencies
);
output
(
"
\n
"
);
}
...
...
tools/wmc/utils.c
View file @
8247686c
...
...
@@ -200,6 +200,13 @@ char *strmake( const char* fmt, ... )
}
}
int
strendswith
(
const
char
*
str
,
const
char
*
end
)
{
int
l
=
strlen
(
str
);
int
m
=
strlen
(
end
);
return
l
>=
m
&&
!
strcmp
(
str
+
l
-
m
,
end
);
}
int
unistrlen
(
const
WCHAR
*
s
)
{
int
n
;
...
...
tools/wmc/utils.h
View file @
8247686c
...
...
@@ -43,6 +43,7 @@ void error(const char *s, ...) __attribute__((format (printf, 1, 2)));
void
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
char
*
dup_basename
(
const
char
*
name
,
const
char
*
ext
);
int
strendswith
(
const
char
*
str
,
const
char
*
end
);
WCHAR
*
xunistrdup
(
const
WCHAR
*
str
);
WCHAR
*
unistrcpy
(
WCHAR
*
dst
,
const
WCHAR
*
src
);
...
...
tools/wmc/wmc.c
View file @
8247686c
...
...
@@ -126,6 +126,7 @@ FILE *yyin;
static
enum
{
FORMAT_UNKNOWN
,
FORMAT_RC
,
FORMAT_RES
,
FORMAT_POT
...
...
@@ -287,6 +288,15 @@ int main(int argc,char *argv[])
input_name
=
argv
[
optind
];
}
/* Guess output format */
if
(
output_format
==
FORMAT_UNKNOWN
)
{
if
(
output_name
&&
strendswith
(
output_name
,
".res"
))
output_format
=
FORMAT_RES
;
else
if
(
output_name
&&
strendswith
(
output_name
,
".pot"
))
output_format
=
FORMAT_POT
;
else
output_format
=
FORMAT_RC
;
}
if
(
output_format
==
FORMAT_RES
)
unicodeout
=
1
;
/* Generate appropriate outfile names */
if
(
!
output_name
)
{
...
...
@@ -340,6 +350,8 @@ int main(int argc,char *argv[])
case
FORMAT_POT
:
write_pot_file
(
output_name
);
break
;
default:
break
;
}
output_name
=
NULL
;
header_name
=
NULL
;
...
...
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