Module: wine Branch: master Commit: 683e45549768145aeed80dca54b24b4e2484f543 URL: https://source.winehq.org/git/wine.git/?a=commit;h=683e45549768145aeed80dca5...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Sep 23 15:53:28 2019 +0200
winegcc: Always search the standard include dirs.
By analogy with the library dir search.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tools/winegcc/winegcc.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 1af94ca63b..33dcad1e4c 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -804,16 +804,26 @@ no_compat_defines: /* standard includes come last in the include search path */ if (!opts->wine_objdir && !opts->nostdinc) { + const char *incl_dirs[] = { INCLUDEDIR, "/usr/include", "/usr/local/include" }; const char *root = opts->isysroot ? opts->isysroot : opts->sysroot ? opts->sysroot : ""; + if (opts->use_msvcrt) { - strarray_add(comp_args, strmake( "%s%s%s/wine/msvcrt", - gcc_defs ? "-isystem" : "-I", root, INCLUDEDIR )); + for (j = 0; j < ARRAY_SIZE(incl_dirs); j++) + { + if (j && !strcmp( incl_dirs[0], incl_dirs[j] )) continue; + strarray_add(comp_args, strmake( "%s%s%s/wine/msvcrt", + gcc_defs ? "-isystem" : "-I", root, incl_dirs[j] )); + } strarray_add(comp_args, "-D__MSVCRT__"); } - strarray_add(comp_args, strmake( "-I%s%s", root, INCLUDEDIR )); - strarray_add(comp_args, strmake( "%s%s%s/wine/windows", - gcc_defs ? "-isystem" : "-I", root, INCLUDEDIR )); + for (j = 0; j < ARRAY_SIZE(incl_dirs); j++) + { + if (j && !strcmp( incl_dirs[0], incl_dirs[j] )) continue; + strarray_add(comp_args, strmake( "-I%s%s", root, incl_dirs[j] )); + strarray_add(comp_args, strmake( "%s%s%s/wine/windows", + gcc_defs ? "-isystem" : "-I", root, incl_dirs[j] )); + } } else if (opts->wine_objdir) strarray_add(comp_args, strmake("-I%s/include", opts->wine_objdir) );