Jacek Caban : winegcc: Use -idirafter for system include paths.

Alexandre Julliard julliard at winehq.org
Thu Apr 22 15:55:25 CDT 2021


Module: wine
Branch: master
Commit: 5a1d836def24043b4e7afcdc8cf1342223957edf
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5a1d836def24043b4e7afcdc8cf1342223957edf

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Apr 22 18:30:52 2021 +0200

winegcc: Use -idirafter for system include paths.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50996
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winegcc/winegcc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 694e2544a24..bf72b612034 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -904,6 +904,7 @@ no_compat_defines:
         const char *incl_dirs[] = { INCLUDEDIR, "/usr/include", "/usr/local/include" };
         const char *root = opts->isysroot ? opts->isysroot : opts->sysroot ? opts->sysroot : "";
         const char *isystem = gcc_defs ? "-isystem" : "-I";
+        const char *idirafter = gcc_defs ? "-idirafter" : "-I";
 
         if (opts->use_msvcrt)
         {
@@ -915,17 +916,16 @@ no_compat_defines:
             }
             strarray_add(comp_args, "-D__MSVCRT__");
         }
-        if (includedir) strarray_add( comp_args, strmake( "%s%s/wine/windows", isystem, includedir ));
-        for (j = 0; j < ARRAY_SIZE(incl_dirs); j++)
+        if (includedir)
         {
-            if (j && !strcmp( incl_dirs[0], incl_dirs[j] )) continue;
-            strarray_add(comp_args, strmake( "%s%s%s/wine/windows", isystem, root, incl_dirs[j] ));
+            strarray_add( comp_args, strmake( "%s%s/wine/windows", isystem, includedir ));
+            strarray_add( comp_args, strmake( "%s%s", idirafter, includedir ));
         }
-        if (includedir) strarray_add( comp_args, strmake( "%s%s", isystem, 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", isystem, root, incl_dirs[j] ));
+            strarray_add(comp_args, strmake( "%s%s%s/wine/windows", isystem, root, incl_dirs[j] ));
+            strarray_add(comp_args, strmake( "%s%s%s", idirafter, root, incl_dirs[j] ));
         }
     }
     else if (opts->wine_objdir)




More information about the wine-cvs mailing list