Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
4d555925
Commit
4d555925
authored
Mar 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Move temp file management from wpp to widl.
parent
cb9be964
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
parser.l
tools/widl/parser.l
+14
-4
widl.c
tools/widl/widl.c
+16
-1
No files found.
tools/widl/parser.l
View file @
4d555925
...
...
@@ -42,6 +42,7 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)*
%{
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -442,10 +443,10 @@ struct imports {
int do_import(char *fname)
{
FILE *f;
char *path;
char *path
, *name
;
struct imports *import;
int ptr = import_stack_ptr;
int ret;
int ret
, fd
;
import = first_import;
while (import && strcmp(import->name, fname))
...
...
@@ -460,7 +461,7 @@ int do_import(char *fname)
/* don't search for a file name with a path in the include directories,
* for compatibility with MIDL */
if (strchr( fname, '/' ) || strchr( fname, '\\' ))
path = strdup( fname );
path =
x
strdup( fname );
else if (!(path = wpp_find_include( fname, input_name )))
error_loc("Unable to open include file %s\n", fname);
...
...
@@ -471,7 +472,16 @@ int do_import(char *fname)
input_name = path;
line_number = 1;
ret = wpp_parse_temp( path, NULL, &temp_name );
name = xstrdup( "widl.XXXXXX" );
if((fd = mkstemps( name, 0 )) == -1)
error("Could not generate a temp name from %s\n", name);
temp_name = name;
if (!(f = fdopen(fd, "wt")))
error("Could not open fd %s for writing\n", name);
ret = wpp_parse( path, f );
fclose( f );
if (ret) exit(1);
if((f = fopen(temp_name, "r")) == NULL)
...
...
tools/widl/widl.c
View file @
4d555925
...
...
@@ -701,7 +701,22 @@ int main(int argc,char *argv[])
if
(
!
preprocess_only
)
{
ret
=
wpp_parse_temp
(
input_name
,
header_name
,
&
temp_name
);
FILE
*
output
;
int
fd
;
char
*
name
=
xmalloc
(
strlen
(
header_name
)
+
8
);
strcpy
(
name
,
header_name
);
strcat
(
name
,
".XXXXXX"
);
if
((
fd
=
mkstemps
(
name
,
0
))
==
-
1
)
error
(
"Could not generate a temp name from %s
\n
"
,
name
);
temp_name
=
name
;
if
(
!
(
output
=
fdopen
(
fd
,
"wt"
)))
error
(
"Could not open fd %s for writing
\n
"
,
name
);
ret
=
wpp_parse
(
input_name
,
output
);
fclose
(
output
);
}
else
{
...
...
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