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
67f6c6c0
Commit
67f6c6c0
authored
Mar 04, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add a helper function to open a temporary file as output.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aa0572f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
23 deletions
+25
-23
build.h
tools/winebuild/build.h
+1
-0
import.c
tools/winebuild/import.c
+11
-16
utils.c
tools/winebuild/utils.c
+13
-7
No files found.
tools/winebuild/build.h
View file @
67f6c6c0
...
...
@@ -260,6 +260,7 @@ extern FILE *open_input_file( const char *srcdir, const char *name );
extern
void
close_input_file
(
FILE
*
file
);
extern
void
open_output_file
(
void
);
extern
void
close_output_file
(
void
);
extern
char
*
open_temp_output_file
(
const
char
*
suffix
);
extern
void
dump_bytes
(
const
void
*
buffer
,
unsigned
int
size
);
extern
int
remove_stdcall_decoration
(
char
*
name
);
extern
void
assemble_file
(
const
char
*
src_file
,
const
char
*
obj_file
);
...
...
tools/winebuild/import.c
View file @
67f6c6c0
...
...
@@ -489,22 +489,20 @@ static char *create_undef_symbols_file( DLLSPEC *spec )
char
*
as_file
,
*
obj_file
;
int
i
;
unsigned
int
j
;
FILE
*
f
;
as_file
=
get_temp_file_name
(
output_file_name
,
".s"
);
if
(
!
(
f
=
fopen
(
as_file
,
"w"
)))
fatal_error
(
"Cannot create %s
\n
"
,
as_file
);
fprintf
(
f
,
"
\t
.data
\n
"
);
as_file
=
open_temp_output_file
(
".s"
);
output
(
"
\t
.data
\n
"
);
for
(
i
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
{
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
odp
->
type
==
TYPE_STUB
||
odp
->
type
==
TYPE_ABS
||
odp
->
type
==
TYPE_VARIABLE
)
continue
;
if
(
odp
->
flags
&
FLAG_FORWARD
)
continue
;
fprintf
(
f
,
"
\t
%s %s
\n
"
,
get_asm_ptr_keyword
(),
asm_name
(
odp
->
link_name
)
);
output
(
"
\t
%s %s
\n
"
,
get_asm_ptr_keyword
(),
asm_name
(
odp
->
link_name
)
);
}
for
(
j
=
0
;
j
<
extra_ld_symbols
.
count
;
j
++
)
fprintf
(
f
,
"
\t
%s %s
\n
"
,
get_asm_ptr_keyword
(),
asm_name
(
extra_ld_symbols
.
str
[
j
])
);
fclose
(
f
);
output
(
"
\t
%s %s
\n
"
,
get_asm_ptr_keyword
(),
asm_name
(
extra_ld_symbols
.
str
[
j
])
);
fclose
(
output_file
);
obj_file
=
get_temp_file_name
(
output_file_name
,
".o"
);
assemble_file
(
as_file
,
obj_file
);
...
...
@@ -1332,13 +1330,12 @@ void output_imports( DLLSPEC *spec )
}
/* create a new asm temp file */
static
void
new_output_as_file
(
const
char
*
prefix
)
static
void
new_output_as_file
(
void
)
{
char
*
name
=
get_temp_file_name
(
prefix
,
".s"
)
;
char
*
name
;
if
(
output_file
)
fclose
(
output_file
);
if
(
!
(
output_file
=
fopen
(
name
,
"w"
)))
fatal_error
(
"Unable to create output file '%s'
\n
"
,
name
);
name
=
open_temp_output_file
(
".s"
);
strarray_add
(
&
as_files
,
name
,
NULL
);
}
...
...
@@ -1381,9 +1378,7 @@ static void build_windows_import_lib( DLLSPEC *spec )
char
*
def_file
;
const
char
*
as_flags
,
*
m_flag
;
def_file
=
get_temp_file_name
(
output_file_name
,
".def"
);
if
(
!
(
output_file
=
fopen
(
def_file
,
"w"
)))
fatal_error
(
"Unable to create output file '%s'
\n
"
,
def_file
);
def_file
=
open_temp_output_file
(
".def"
);
output_def_file
(
spec
,
0
);
fclose
(
output_file
);
...
...
@@ -1442,7 +1437,7 @@ static void build_unix_import_lib( DLLSPEC *spec )
case
TYPE_CDECL
:
case
TYPE_STDCALL
:
prefix
=
(
!
odp
->
name
||
(
odp
->
flags
&
FLAG_ORDINAL
))
?
import_ord_prefix
:
import_func_prefix
;
new_output_as_file
(
spec
->
file_name
);
new_output_as_file
();
output
(
"
\t
.text
\n
"
);
output
(
"
\n\t
.align %d
\n
"
,
get_alignment
(
get_ptr_size
()
));
output
(
"
\t
%s
\n
"
,
func_declaration
(
name
)
);
...
...
@@ -1461,7 +1456,7 @@ static void build_unix_import_lib( DLLSPEC *spec )
if
(
!
as_files
.
count
)
/* create a dummy file to avoid empty import libraries */
{
new_output_as_file
(
spec
->
file_name
);
new_output_as_file
();
output
(
"
\t
.text
\n
"
);
}
...
...
tools/winebuild/utils.c
View file @
67f6c6c0
...
...
@@ -734,16 +734,10 @@ void open_output_file(void)
if
(
output_file_name
)
{
if
(
strendswith
(
output_file_name
,
".o"
))
{
output_file_source_name
=
get_temp_file_name
(
output_file_name
,
".s"
);
if
(
!
(
output_file
=
fopen
(
output_file_source_name
,
"w"
)))
fatal_error
(
"Unable to create output file '%s'
\n
"
,
output_file_name
);
}
output_file_source_name
=
open_temp_output_file
(
".s"
);
else
{
if
(
!
(
output_file
=
fopen
(
output_file_name
,
"w"
)))
fatal_error
(
"Unable to create output file '%s'
\n
"
,
output_file_name
);
}
}
else
output_file
=
stdout
;
}
...
...
@@ -762,6 +756,18 @@ void close_output_file(void)
/*******************************************************************
* open_temp_output_file
*/
char
*
open_temp_output_file
(
const
char
*
suffix
)
{
char
*
tmp_file
=
get_temp_file_name
(
output_file_name
,
suffix
);
if
(
!
(
output_file
=
fopen
(
tmp_file
,
"w"
)))
fatal_error
(
"Unable to create output file '%s'
\n
"
,
tmp_file
);
return
tmp_file
;
}
/*******************************************************************
* remove_stdcall_decoration
*
* Remove a possible @xx suffix from a function name.
...
...
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