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
90a543d3
Commit
90a543d3
authored
Jan 30, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Also search the include dir relative to the binary path.
Suggested by Kevin Puetz. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5417826c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
Makefile.in
tools/widl/Makefile.in
+3
-1
widl.c
tools/widl/widl.c
+28
-0
No files found.
tools/widl/Makefile.in
View file @
90a543d3
...
...
@@ -19,7 +19,9 @@ C_SRCS = \
LEX_SRCS
=
parser.l
BISON_SRCS
=
parser.y
widl_EXTRADEFS
=
-DINCLUDEDIR
=
\"
${
includedir
}
\"
widl_EXTRADEFS
=
\
-DINCLUDEDIR
=
"
\"
${
includedir
}
\"
"
\
-DBIN_TO_INCLUDEDIR
=
\"
`
$(MAKEDEP)
-R
${
bindir
}
${
includedir
}
`
\"
EXTRALIBS
=
-lwpp
...
...
tools/widl/widl.c
View file @
90a543d3
...
...
@@ -150,6 +150,7 @@ static char *idfile_name;
char
*
temp_name
;
const
char
*
prefix_client
=
""
;
const
char
*
prefix_server
=
""
;
static
const
char
*
includedir
;
int
line_number
=
1
;
...
...
@@ -572,6 +573,27 @@ void write_id_data(const statement_list_t *stmts)
fclose
(
idfile
);
}
static
void
init_argv0_dir
(
const
char
*
argv0
)
{
#ifndef _WIN32
char
*
p
,
*
dir
;
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
#elif defined (__FreeBSD__) || defined(__DragonFly__)
dir
=
realpath
(
"/proc/curproc/file"
,
NULL
);
#else
dir
=
realpath
(
argv0
,
NULL
);
#endif
if
(
!
dir
)
return
;
if
(
!
(
p
=
strrchr
(
dir
,
'/'
)))
return
;
if
(
p
==
dir
)
p
++
;
*
p
=
0
;
includedir
=
strmake
(
"%s/%s"
,
dir
,
BIN_TO_INCLUDEDIR
);
free
(
dir
);
#endif
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
,
optc
;
...
...
@@ -585,6 +607,7 @@ int main(int argc,char *argv[])
#ifdef SIGHUP
signal
(
SIGHUP
,
exit_on_signal
);
#endif
init_argv0_dir
(
argv
[
0
]
);
now
=
time
(
NULL
);
...
...
@@ -751,6 +774,11 @@ int main(int argc,char *argv[])
{
static
const
char
*
incl_dirs
[]
=
{
INCLUDEDIR
,
"/usr/include"
,
"/usr/local/include"
};
if
(
includedir
)
{
wpp_add_include_path
(
strmake
(
"%s/wine/msvcrt"
,
includedir
));
wpp_add_include_path
(
strmake
(
"%s/wine/windows"
,
includedir
));
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
incl_dirs
);
i
++
)
{
if
(
i
&&
!
strcmp
(
incl_dirs
[
i
],
incl_dirs
[
0
]
))
continue
;
...
...
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