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
36c31997
Commit
36c31997
authored
Oct 10, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default search path for an include file should be based on the path of
the parent source file, not the current directory.
parent
e573caf8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
13 deletions
+22
-13
wpp.h
include/wine/wpp.h
+1
-1
ppl.l
libs/wpp/ppl.l
+1
-1
preproc.c
libs/wpp/preproc.c
+17
-8
wpp_private.h
libs/wpp/wpp_private.h
+1
-1
parser.l
tools/widl/parser.l
+1
-1
parser.y
tools/wrc/parser.y
+1
-1
No files found.
include/wine/wpp.h
View file @
36c31997
...
@@ -29,7 +29,7 @@ extern void wpp_add_cmdline_define( const char *value );
...
@@ -29,7 +29,7 @@ extern void wpp_add_cmdline_define( const char *value );
extern
void
wpp_set_debug
(
int
lex_debug
,
int
parser_debug
,
int
msg_debug
);
extern
void
wpp_set_debug
(
int
lex_debug
,
int
parser_debug
,
int
msg_debug
);
extern
void
wpp_set_pedantic
(
int
on
);
extern
void
wpp_set_pedantic
(
int
on
);
extern
void
wpp_add_include_path
(
const
char
*
path
);
extern
void
wpp_add_include_path
(
const
char
*
path
);
extern
char
*
wpp_find_include
(
const
char
*
name
,
int
search
);
extern
char
*
wpp_find_include
(
const
char
*
name
,
const
char
*
parent_name
);
extern
int
wpp_parse
(
const
char
*
input
,
FILE
*
output
);
extern
int
wpp_parse
(
const
char
*
input
,
FILE
*
output
);
extern
int
wpp_parse_temp
(
const
char
*
input
,
const
char
*
output_base
,
char
**
output_name
);
extern
int
wpp_parse_temp
(
const
char
*
input
,
const
char
*
output_base
,
char
**
output_name
);
...
...
libs/wpp/ppl.l
View file @
36c31997
...
@@ -1445,7 +1445,7 @@ void pp_do_include(char *fname, int type)
...
@@ -1445,7 +1445,7 @@ void pp_do_include(char *fname, int type)
/* Undo the effect of the quotation */
/* Undo the effect of the quotation */
fname[n-1] = '\0';
fname[n-1] = '\0';
if((ppin = pp_open_include(fname+1, type, &newpath)) == NULL)
if((ppin = pp_open_include(fname+1, type
? pp_status.input : NULL
, &newpath)) == NULL)
pperror("Unable to open include file %s", fname+1);
pperror("Unable to open include file %s", fname+1);
fname[n-1] = *fname; /* Redo the quotes */
fname[n-1] = *fname; /* Redo the quotes */
...
...
libs/wpp/preproc.c
View file @
36c31997
...
@@ -355,10 +355,11 @@ void wpp_add_include_path(const char *path)
...
@@ -355,10 +355,11 @@ void wpp_add_include_path(const char *path)
free
(
cpy
);
free
(
cpy
);
}
}
char
*
wpp_find_include
(
const
char
*
name
,
int
search
)
char
*
wpp_find_include
(
const
char
*
name
,
const
char
*
parent_name
)
{
{
char
*
cpy
;
char
*
cpy
;
char
*
cptr
;
char
*
cptr
;
char
*
path
;
const
char
*
ccptr
;
const
char
*
ccptr
;
int
i
,
fd
;
int
i
,
fd
;
...
@@ -380,20 +381,28 @@ char *wpp_find_include(const char *name, int search)
...
@@ -380,20 +381,28 @@ char *wpp_find_include(const char *name, int search)
}
}
*
cptr
=
'\0'
;
*
cptr
=
'\0'
;
if
(
search
)
if
(
parent_name
)
{
{
/* Search current dir and then -I path */
/* Search directory of parent include and then -I path */
fd
=
open
(
cpy
,
O_RDONLY
);
const
char
*
p
;
if
((
p
=
strrchr
(
parent_name
,
'/'
)))
p
++
;
else
p
=
parent_name
;
path
=
pp_xmalloc
(
(
p
-
parent_name
)
+
strlen
(
cpy
)
+
1
);
memcpy
(
path
,
parent_name
,
p
-
parent_name
);
strcpy
(
path
+
(
p
-
parent_name
),
cpy
);
fd
=
open
(
path
,
O_RDONLY
);
if
(
fd
!=
-
1
)
if
(
fd
!=
-
1
)
{
{
close
(
fd
);
close
(
fd
);
return
cpy
;
free
(
cpy
);
return
path
;
}
}
free
(
path
);
}
}
/* Search -I path */
/* Search -I path */
for
(
i
=
0
;
i
<
nincludepath
;
i
++
)
for
(
i
=
0
;
i
<
nincludepath
;
i
++
)
{
{
char
*
path
;
path
=
pp_xmalloc
(
strlen
(
includepath
[
i
])
+
strlen
(
cpy
)
+
2
);
path
=
pp_xmalloc
(
strlen
(
includepath
[
i
])
+
strlen
(
cpy
)
+
2
);
strcpy
(
path
,
includepath
[
i
]);
strcpy
(
path
,
includepath
[
i
]);
strcat
(
path
,
"/"
);
strcat
(
path
,
"/"
);
...
@@ -411,12 +420,12 @@ char *wpp_find_include(const char *name, int search)
...
@@ -411,12 +420,12 @@ char *wpp_find_include(const char *name, int search)
return
NULL
;
return
NULL
;
}
}
FILE
*
pp_open_include
(
const
char
*
name
,
int
search
,
char
**
newpath
)
FILE
*
pp_open_include
(
const
char
*
name
,
const
char
*
parent_name
,
char
**
newpath
)
{
{
char
*
path
;
char
*
path
;
FILE
*
fp
;
FILE
*
fp
;
if
(
!
(
path
=
wpp_find_include
(
name
,
search
)))
return
NULL
;
if
(
!
(
path
=
wpp_find_include
(
name
,
parent_name
)))
return
NULL
;
fp
=
fopen
(
path
,
"rt"
);
fp
=
fopen
(
path
,
"rt"
);
if
(
fp
)
if
(
fp
)
...
...
libs/wpp/wpp_private.h
View file @
36c31997
...
@@ -200,7 +200,7 @@ void pp_pop_define_state(void);
...
@@ -200,7 +200,7 @@ void pp_pop_define_state(void);
pp_entry_t
*
pp_add_define
(
char
*
def
,
char
*
text
);
pp_entry_t
*
pp_add_define
(
char
*
def
,
char
*
text
);
pp_entry_t
*
pp_add_macro
(
char
*
ident
,
marg_t
*
args
[],
int
nargs
,
mtext_t
*
exp
);
pp_entry_t
*
pp_add_macro
(
char
*
ident
,
marg_t
*
args
[],
int
nargs
,
mtext_t
*
exp
);
void
pp_del_define
(
const
char
*
name
);
void
pp_del_define
(
const
char
*
name
);
FILE
*
pp_open_include
(
const
char
*
name
,
int
search
,
char
**
newpath
);
FILE
*
pp_open_include
(
const
char
*
name
,
const
char
*
parent_name
,
char
**
newpath
);
void
pp_push_if
(
pp_if_state_t
s
);
void
pp_push_if
(
pp_if_state_t
s
);
void
pp_next_if_state
(
int
);
void
pp_next_if_state
(
int
);
pp_if_state_t
pp_pop_if
(
void
);
pp_if_state_t
pp_pop_if
(
void
);
...
...
tools/widl/parser.l
View file @
36c31997
...
@@ -417,7 +417,7 @@ int do_import(char *fname)
...
@@ -417,7 +417,7 @@ int do_import(char *fname)
import->next = first_import;
import->next = first_import;
first_import = import;
first_import = import;
if (!(path = wpp_find_include( fname,
1
)))
if (!(path = wpp_find_include( fname,
input_name
)))
yyerror("Unable to open include file %s", fname);
yyerror("Unable to open include file %s", fname);
import_stack[ptr].temp_name = temp_name;
import_stack[ptr].temp_name = temp_name;
...
...
tools/wrc/parser.y
View file @
36c31997
...
@@ -2311,7 +2311,7 @@ static raw_data_t *load_file(string_t *filename, language_t *lang)
...
@@ -2311,7 +2311,7 @@ static raw_data_t *load_file(string_t *filename, language_t *lang)
if
(codepage
<=
0
&&
filename->type
!=
str_char)
if
(codepage
<=
0
&&
filename->type
!=
str_char)
yyerror("Cannot
convert
filename
to
ASCII
string");
yyerror("Cannot
convert
filename
to
ASCII
string");
name
=
convert_string(
filename,
str_char,
codepage
);
name
=
convert_string(
filename,
str_char,
codepage
);
if
(!(path
=
wpp_find_include(name->str.cstr,
1
)))
if
(!(path
=
wpp_find_include(name->str.cstr,
input_name
)))
yyerror("Cannot
open
file
%s",
name->str.cstr);
yyerror("Cannot
open
file
%s",
name->str.cstr);
if
(!(fp
=
fopen(
path,
"rb"
)))
if
(!(fp
=
fopen(
path,
"rb"
)))
yyerror("Cannot
open
file
%s",
name->str.cstr);
yyerror("Cannot
open
file
%s",
name->str.cstr);
...
...
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