Use -isystem for system includes as they should be processed after the
-I includes. Spotted by Boaz Harrosh.
This commit is contained in:
parent
8435f6f058
commit
cfb6c8ebca
|
@ -258,15 +258,7 @@ static void compile(struct options* opts, const char* lang)
|
|||
#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 @@ static void compile(struct options* opts, const char* lang)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue