diff --git a/autoload/color_coded.vim b/autoload/color_coded.vim index dafb822..6eeaaf2 100644 --- a/autoload/color_coded.vim +++ b/autoload/color_coded.vim @@ -4,7 +4,7 @@ " Setup " ------------------------------------------------------------------------------ -let s:color_coded_api_version = 0x970565b +let s:color_coded_api_version = 0xcfac0c1 let s:color_coded_valid = 1 let s:color_coded_unique_counter = 1 let g:color_coded_matches = {} diff --git a/include/conf/defaults.hpp b/include/conf/defaults.hpp index 69e4b38..953f804 100644 --- a/include/conf/defaults.hpp +++ b/include/conf/defaults.hpp @@ -14,6 +14,17 @@ namespace color_coded /* Prefixed onto every set of args to make life easier. */ inline args_t pre_constants(std::string const &filetype) { + /* These C++ include paths must always precede /usr/include and alike. */ + args_t cpp_includes = + { + /* Local clang+llvm */ + environment::clang_include_cpp, + environment::clang_include, + /* System clang on macOS */ + "-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", + "-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", + }; + if(filetype == "c") { return @@ -30,18 +41,24 @@ namespace color_coded } else if(filetype == "objective-c++") { - return + args_t args = { - "-x", "objective-c", + "-x", "objective-c++", }; + std::move(cpp_includes.begin(), cpp_includes.end(), + std::back_inserter(args)); + return args; } else // C++ or something else { - return + args_t args = { "-x", "c++", "-std=c++14", }; + std::move(cpp_includes.begin(), cpp_includes.end(), + std::back_inserter(args)); + return args; } } @@ -49,14 +66,10 @@ namespace color_coded { return { - environment::clang_resource_dir, - environment::clang_include, - environment::clang_include_cpp, "-isystem/usr/local/include", "-isystem/opt/local/include", + environment::clang_resource_dir, // internal libraries and intrinsics "-isystem/usr/include", - "-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", - "-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", "-isystem/System/Library/Frameworks", "-isystem/Library/Frameworks", "-w", diff --git a/src/main.cpp b/src/main.cpp index a5f43d2..3286512 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,7 +66,7 @@ namespace color_coded static int api_version(lua_State * const lua) { - std::size_t constexpr const version{ 0x970565b }; + std::size_t constexpr const version{ 0xcfac0c1 }; lua_pushinteger(lua, version); return 1; }