Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #146 from Hexcles/ensure-search-order
Browse files Browse the repository at this point in the history
Ensure the order of search paths for C++
  • Loading branch information
jeaye authored Jan 26, 2017
2 parents cfac0c1 + 5db6d62 commit c3b4d73
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion autoload/color_coded.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
29 changes: 21 additions & 8 deletions include/conf/defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<env::tag>::clang_include_cpp,
environment<env::tag>::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
Expand All @@ -30,33 +41,35 @@ 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;
}
}

inline args_t post_constants()
{
return
{
environment<env::tag>::clang_resource_dir,
environment<env::tag>::clang_include,
environment<env::tag>::clang_include_cpp,
"-isystem/usr/local/include",
"-isystem/opt/local/include",
environment<env::tag>::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",
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c3b4d73

Please sign in to comment.