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
0a66eaea
Commit
0a66eaea
authored
Feb 07, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Set the output format from the output file name.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe888bbb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
29 deletions
+30
-29
makedep.c
tools/makedep.c
+15
-28
utils.c
tools/wrc/utils.c
+7
-0
utils.h
tools/wrc/utils.h
+1
-0
wrc.c
tools/wrc/wrc.c
+7
-1
No files found.
tools/makedep.c
View file @
0a66eaea
...
...
@@ -2705,49 +2705,36 @@ static void output_source_h( struct makefile *make, struct incl_file *source, co
static
void
output_source_rc
(
struct
makefile
*
make
,
struct
incl_file
*
source
,
const
char
*
obj
)
{
struct
strarray
defines
=
get_source_defines
(
make
,
source
,
obj
);
char
*
po_dir
=
NULL
;
unsigned
int
i
;
if
(
source
->
file
->
flags
&
FLAG_GENERATED
)
strarray_add
(
&
make
->
clean_files
,
source
->
name
);
if
(
linguas
.
count
&&
(
source
->
file
->
flags
&
FLAG_RC_PO
))
po_dir
=
top_obj_dir_path
(
make
,
"po"
);
strarray_add
(
&
make
->
res_files
,
strmake
(
"%s.res"
,
obj
));
output
(
"%s.res: %s
\n
"
,
obj_dir_path
(
make
,
obj
),
source
->
filename
);
if
(
source
->
file
->
flags
&
FLAG_RC_PO
&&
!
(
source
->
file
->
flags
&
FLAG_PARENTDIR
))
{
strarray_add
(
&
make
->
clean_files
,
strmake
(
"%s.pot"
,
obj
));
output
(
"%s.pot "
,
obj_dir_path
(
make
,
obj
)
);
}
output
(
"%s.res: %s"
,
obj_dir_path
(
make
,
obj
),
source
->
filename
);
output_filename
(
tools_path
(
make
,
"wrc"
));
output_filenames
(
source
->
dependencies
);
output
(
"
\n
"
);
output
(
"
\t
%s -u -o $@"
,
tools_path
(
make
,
"wrc"
)
);
if
(
make
->
is_win16
)
output_filename
(
"-m16"
);
else
output_filenames
(
target_flags
);
output_filename
(
"--nostdinc"
);
if
(
po_dir
)
output_filename
(
strmake
(
"--po-dir=%s"
,
po_dir
));
output_filenames
(
defines
);
if
(
linguas
.
count
&&
(
source
->
file
->
flags
&
FLAG_RC_PO
))
output_filename
(
source
->
filename
);
output
(
"
\n
"
);
if
(
po_dir
)
{
char
*
po_dir
=
top_obj_dir_path
(
make
,
"po"
);
output_filename
(
strmake
(
"--po-dir=%s"
,
po_dir
));
output_filename
(
source
->
filename
);
output
(
"
\n
"
);
output
(
"%s.res:"
,
obj_dir_path
(
make
,
obj
));
for
(
i
=
0
;
i
<
linguas
.
count
;
i
++
)
output_filename
(
strmake
(
"%s/%s.mo"
,
po_dir
,
linguas
.
str
[
i
]
));
output
(
"
\n
"
);
}
else
{
output_filename
(
source
->
filename
);
output
(
"
\n
"
);
}
if
(
source
->
file
->
flags
&
FLAG_RC_PO
&&
!
(
source
->
file
->
flags
&
FLAG_PARENTDIR
))
{
strarray_add
(
&
make
->
clean_files
,
strmake
(
"%s.pot"
,
obj
));
output
(
"%s.pot: %s
\n
"
,
obj_dir_path
(
make
,
obj
),
source
->
filename
);
output
(
"
\t
%s -u -O pot -o $@"
,
tools_path
(
make
,
"wrc"
)
);
if
(
make
->
is_win16
)
output_filename
(
"-m16"
);
else
output_filenames
(
target_flags
);
output_filename
(
"--nostdinc"
);
output_filenames
(
defines
);
output_filename
(
source
->
filename
);
output
(
"
\n
"
);
output
(
"%s.pot "
,
obj_dir_path
(
make
,
obj
));
}
output
(
"%s.res:"
,
obj_dir_path
(
make
,
obj
));
output_filename
(
tools_path
(
make
,
"wrc"
));
output_filenames
(
source
->
dependencies
);
output
(
"
\n
"
);
}
...
...
tools/wrc/utils.c
View file @
0a66eaea
...
...
@@ -219,6 +219,13 @@ char *xstrdup(const char *str)
return
strcpy
(
s
,
str
);
}
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
compare_striA
(
const
char
*
str1
,
const
char
*
str2
)
{
for
(;;)
...
...
tools/wrc/utils.h
View file @
0a66eaea
...
...
@@ -36,6 +36,7 @@ char *xstrdup(const char *str);
int
compare_striA
(
const
char
*
str1
,
const
char
*
str2
);
int
compare_striW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
);
char
*
strmake
(
const
char
*
fmt
,
...)
__attribute__
((
__format__
(
__printf__
,
1
,
2
)));
int
strendswith
(
const
char
*
str
,
const
char
*
end
);
int
parser_error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
parser_warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
internal_error
(
const
char
*
file
,
int
line
,
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
3
,
4
),
noreturn
));
...
...
tools/wrc/wrc.c
View file @
0a66eaea
...
...
@@ -589,8 +589,14 @@ int main(int argc,char *argv[])
verify_translations
(
resource_top
);
exit
(
0
);
}
if
(
!
po_mode
&&
output_name
)
{
if
(
strendswith
(
output_name
,
".po"
))
po_mode
=
1
;
else
if
(
strendswith
(
output_name
,
".pot"
))
po_mode
=
2
;
}
if
(
po_mode
)
{
if
(
!
win32
)
error
(
"PO files are not supported in 16-bit mode
\n
"
);
if
(
po_mode
==
2
)
/* pot file */
{
if
(
!
output_name
)
...
...
@@ -604,7 +610,7 @@ int main(int argc,char *argv[])
output_name
=
NULL
;
exit
(
0
);
}
add_translations
(
po_dir
);
if
(
win32
)
add_translations
(
po_dir
);
/* Convert the internal lists to binary data */
resources2res
(
resource_top
);
...
...
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