Zebediah Figura : makedep: Check for external libraries instead of include paths when determining whether to allow external includes.
Module: wine Branch: master Commit: e454c62f36c7330fbdb59815771966a8d4b90c4a URL: https://source.winehq.org/git/wine.git/?a=commit;h=e454c62f36c7330fbdb598157... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Nov 29 16:43:06 2021 -0600 makedep: Check for external libraries instead of include paths when determining whether to allow external includes. The include path may be empty, e.g. if the relevant headers are to be found directly in the MinGW sysroot. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/makedep.c b/tools/makedep.c index ac3e6d969e2..2301ecf191e 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -1286,6 +1286,22 @@ static struct makefile *find_importlib_module( const char *name ) } +/******************************************************************* + * has_external_import + */ +static int has_external_import( const struct makefile *make ) +{ + unsigned int i; + + for (i = 0; i < make->imports.count; i++) + { + if (!strncmp( make->imports.str[i], "-l", 2 )) + return 1; + } + return 0; +} + + /******************************************************************* * open_include_file */ @@ -1404,7 +1420,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_ { if (!strcmp( pFile->name, "stdarg.h" )) return NULL; if (!strcmp( pFile->name, "x86intrin.h" )) return NULL; - if (make->include_paths.count) return NULL; + if (has_external_import( make )) return NULL; fprintf( stderr, "%s:%d: error: system header %s cannot be used with msvcrt\n", pFile->included_by->file->name, pFile->included_line, pFile->name ); exit(1);
participants (1)
-
Alexandre Julliard