mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Fix linux build
This commit is contained in:
parent
d9143f065d
commit
104cfd167c
@ -2626,7 +2626,6 @@ bool QueryDbMainLoop(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case IpcId::CqueryQueryDbWaitForIdleIndexer: {
|
case IpcId::CqueryQueryDbWaitForIdleIndexer: {
|
||||||
auto msg = static_cast<Ipc_CqueryQueryDbWaitForIdleIndexer*>(message.get());
|
|
||||||
LOG_S(INFO) << "Waiting for idle";
|
LOG_S(INFO) << "Waiting for idle";
|
||||||
int idle_count = 0;
|
int idle_count = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -43,7 +43,7 @@ optional<std::string> ReadJsonRpcContentFrom(std::function<optional<char>()> rea
|
|||||||
|
|
||||||
stringified_content_length += c;
|
stringified_content_length += c;
|
||||||
}
|
}
|
||||||
constexpr char* kContentLengthStart = "Content-Length: ";
|
const char* kContentLengthStart = "Content-Length: ";
|
||||||
assert(StartsWith(stringified_content_length, kContentLengthStart));
|
assert(StartsWith(stringified_content_length, kContentLengthStart));
|
||||||
int content_length = atoi(stringified_content_length.c_str() + strlen(kContentLengthStart));
|
int content_length = atoi(stringified_content_length.c_str() + strlen(kContentLengthStart));
|
||||||
|
|
||||||
@ -74,8 +74,9 @@ optional<std::string> ReadJsonRpcContentFrom(std::function<optional<char>()> rea
|
|||||||
|
|
||||||
TEST_SUITE("FindIncludeLine");
|
TEST_SUITE("FindIncludeLine");
|
||||||
|
|
||||||
auto MakeContentReader(std::string* content, bool can_be_empty) {
|
std::function<optional<char>()>
|
||||||
return [=]() -> optional<char> {
|
MakeContentReader(std::string* content, bool can_be_empty) {
|
||||||
|
return [content, can_be_empty]() -> optional<char> {
|
||||||
if (!can_be_empty)
|
if (!can_be_empty)
|
||||||
REQUIRE(!content->empty());
|
REQUIRE(!content->empty());
|
||||||
if (content->empty())
|
if (content->empty())
|
||||||
@ -87,14 +88,14 @@ auto MakeContentReader(std::string* content, bool can_be_empty) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("ReadContentFromSource") {
|
TEST_CASE("ReadContentFromSource") {
|
||||||
auto parse_correct = [](std::string content) {
|
auto parse_correct = [](std::string content) -> std::string {
|
||||||
auto reader = MakeContentReader(&content, false /*can_be_empty*/);
|
auto reader = MakeContentReader(&content, false /*can_be_empty*/);
|
||||||
auto got = ReadJsonRpcContentFrom(reader);
|
auto got = ReadJsonRpcContentFrom(reader);
|
||||||
REQUIRE(got);
|
REQUIRE(got);
|
||||||
return got.value();
|
return got.value();
|
||||||
};
|
};
|
||||||
|
|
||||||
auto parse_incorrect = [](std::string content) {
|
auto parse_incorrect = [](std::string content) -> optional<std::string> {
|
||||||
auto reader = MakeContentReader(&content, true /*can_be_empty*/);
|
auto reader = MakeContentReader(&content, true /*can_be_empty*/);
|
||||||
return ReadJsonRpcContentFrom(reader);
|
return ReadJsonRpcContentFrom(reader);
|
||||||
};
|
};
|
||||||
|
2
wscript
2
wscript
@ -24,7 +24,7 @@ global CLANG_PLATFORM_NAME
|
|||||||
global CLANG_TARBALL_PLATFORM_NAME
|
global CLANG_TARBALL_PLATFORM_NAME
|
||||||
|
|
||||||
if sys.platform == 'linux' or sys.platform == 'linux2':
|
if sys.platform == 'linux' or sys.platform == 'linux2':
|
||||||
CLANG_PLATFORM_NAME = 'linux-x86_64-gnu-ubuntu14.04'
|
CLANG_PLATFORM_NAME = 'linux-x86_64-ubuntu14.04'
|
||||||
CLANG_TARBALL_PLATFORM_NAME = 'clang+llvm'
|
CLANG_TARBALL_PLATFORM_NAME = 'clang+llvm'
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
CLANG_PLATFORM_NAME = 'x86_64-apple-darwin'
|
CLANG_PLATFORM_NAME = 'x86_64-apple-darwin'
|
||||||
|
Loading…
Reference in New Issue
Block a user