diff --git a/external/cxxopts b/external/cxxopts index 1be5f10..9db62cb 160000 --- a/external/cxxopts +++ b/external/cxxopts @@ -1 +1 @@ -Subproject commit 1be5f10daf6f08296eff399e82aa94d16800ef4e +Subproject commit 9db62cb338aeaed1fec5806f6b5d9781f5e19e4c diff --git a/external/tiny-process-library b/external/tiny-process-library index 50f6919..cf212df 160000 --- a/external/tiny-process-library +++ b/external/tiny-process-library @@ -1 +1 @@ -Subproject commit 50f69197c2af03dc93cd0985a39d6809c80a27b5 +Subproject commit cf212df358680ef0b4b30569672c770bd723a7aa diff --git a/external/type_safe b/external/type_safe index 4a80f40..b5fd96d 160000 --- a/external/type_safe +++ b/external/type_safe @@ -1 +1 @@ -Subproject commit 4a80f404a07fda6a190e9ce90548b175df8e1379 +Subproject commit b5fd96de64046e919b30de07cea09135a66cc86f diff --git a/src/libclang/preprocessor.cpp b/src/libclang/preprocessor.cpp index b85ff24..1a83dd5 100644 --- a/src/libclang/preprocessor.cpp +++ b/src/libclang/preprocessor.cpp @@ -138,32 +138,34 @@ namespace std::string get_full_preprocess_output(const libclang_compile_config& c, const char* full_path, const diagnostic_logger& logger) { + namespace tpl = TinyProcessLib; + std::string preprocessed, diagnostic; - auto cmd = get_command(c, full_path); - Process process(cmd, "", - [&](const char* str, std::size_t n) { - preprocessed.reserve(preprocessed.size() + n); - for (auto end = str + n; str != end; ++str) - if (*str == '\t') - preprocessed += " "; // just two spaces because why not - else if (*str != '\r') - preprocessed.push_back(*str); - }, - [&](const char* str, std::size_t n) { - diagnostic.reserve(diagnostic.size() + n); - for (auto end = str + n; str != end; ++str) - if (*str == '\r') - continue; - else if (*str == '\n') - { - // consume current diagnostic - log_diagnostic(logger, diagnostic); - diagnostic.clear(); - } - else - diagnostic.push_back(*str); - }); + auto cmd = get_command(c, full_path); + tpl::Process process(cmd, "", + [&](const char* str, std::size_t n) { + preprocessed.reserve(preprocessed.size() + n); + for (auto end = str + n; str != end; ++str) + if (*str == '\t') + preprocessed += " "; // just two spaces because why not + else if (*str != '\r') + preprocessed.push_back(*str); + }, + [&](const char* str, std::size_t n) { + diagnostic.reserve(diagnostic.size() + n); + for (auto end = str + n; str != end; ++str) + if (*str == '\r') + continue; + else if (*str == '\n') + { + // consume current diagnostic + log_diagnostic(logger, diagnostic); + diagnostic.clear(); + } + else + diagnostic.push_back(*str); + }); auto exit_code = process.get_exit_status(); DEBUG_ASSERT(diagnostic.empty(), detail::assert_handler{});