winegcc: Use -isystem for system includes

Dimitrie O. Paun dpaun at rogers.com
Thu Mar 10 20:39:01 CST 2005


ChangeLog
    Use -isystem for system includes as they should be processed
    after the -I includes. Spotted by Boaz Harrosh.


Index: tools/winegcc/winegcc.c
===================================================================
RCS file: /var/cvs/wine/tools/winegcc/winegcc.c,v
retrieving revision 1.35
diff -u -r1.35 winegcc.c
--- tools/winegcc/winegcc.c	8 Mar 2005 16:55:26 -0000	1.35
+++ tools/winegcc/winegcc.c	10 Mar 2005 05:44:42 -0000
@@ -258,15 +258,7 @@
 #endif
         strarray_addall(comp_args, strarray_fromstring(DLLFLAGS, " "));
     }
-    if (!opts->wine_mode && !opts->nostdinc)
-    {
-        if (opts->use_msvcrt)
-        {
-            strarray_add(comp_args, "-I" INCLUDEDIR "/msvcrt");
-            strarray_add(comp_args, "-D__MSVCRT__");
-        }
-        strarray_add(comp_args, "-I" INCLUDEDIR "/windows");
-    }
+
     strarray_add(comp_args, "-DWIN32");
     strarray_add(comp_args, "-D_WIN32");
     strarray_add(comp_args, "-D__WIN32");
@@ -331,6 +323,23 @@
 	    strarray_add(comp_args, opts->files->base[j]);
     }
 
+    /* standard includes come last in the include search path */
+#ifdef __GNUC__
+#define SYS_INCLUDE "-isystem"
+#else
+#define SYS_INCLUDE "-I"
+#endif
+    if (!opts->wine_mode && !opts->nostdinc)
+    {
+        if (opts->use_msvcrt)
+        {
+            strarray_add(comp_args, SYS_INCLUDE INCLUDEDIR "/msvcrt");
+            strarray_add(comp_args, "-D__MSVCRT__");
+        }
+        strarray_add(comp_args, SYS_INCLUDE INCLUDEDIR "/windows");
+    }
+#undef SYS_INCLUDE
+
     spawn(opts->prefix, comp_args);
 }
 


-- 
Dimi.



More information about the wine-patches mailing list