diff --git a/uppsrc/CppBase/ppconfig.cpp b/uppsrc/CppBase/ppconfig.cpp index 42efce416..ba03ba713 100644 --- a/uppsrc/CppBase/ppconfig.cpp +++ b/uppsrc/CppBase/ppconfig.cpp @@ -19,7 +19,10 @@ String GetStdConfig() "__out;__in;__inout;__deref_in;__deref_inout;__deref_out;" "__pragma(...);__pascal;_far;_pascal;_cdecl;" "__AuToQuOtE;__xin;__xout;__export;" - "__clrcall;__alignof(...)"; + "__clrcall;__alignof(...);" + + "__asm__(...);__asm(...);__restrict;__inline;__typeof;" + ; ValueMap json; ValueArray va; Vector h = Split(ns, ';'); diff --git a/uppsrc/ide/Methods.cpp b/uppsrc/ide/Methods.cpp index 0cd05958d..8672eb103 100644 --- a/uppsrc/ide/Methods.cpp +++ b/uppsrc/ide/Methods.cpp @@ -432,9 +432,25 @@ String Ide::GetIncludePath() { SetupDefaultMethod(); VectorMap bm = GetMethodVars(method); - String include = GetVar("UPP") + ';' + bm.Get("INCLUDE", "") + String include = GetVar("UPP") + ';' + bm.Get("INCLUDE", ""); #ifdef PLATFORM_POSIX - + ";/usr/include;/usr/local/include" + static String sys_includes; + ONCELOCK { + Index r; + for(int pass = 0; pass < 2; pass++) { + String h = Sys(pass ? "clang -v -x c++ -E /dev/null" : "gcc -v -x c++ -E /dev/null"); + Vector ln = Split(h, '\n'); + for(int i = 0; i < ln.GetCount(); i++) { + String dir = TrimBoth(ln[i]); + if(DirectoryExists(dir)) + r.FindAdd(NormalizePath(dir)); + } + } + r.FindAdd("/usr/include"); + r.FindAdd("/usr/local/include"); + sys_includes = Join(r.GetKeys(), ";"); + } + MergeWith(include, ";", sys_includes); #endif ;