diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-13 16:59:21 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-13 17:56:21 -0700 |
| commit | d15818c602e4031cb9ba6cf622182ca6e90f40ba (patch) | |
| tree | a36db2215967b063c4066a5e28dd582d1234477f /toolsrc/src | |
| parent | cbcd29c20954e400bf9f0eef60dd49b0af30abe6 (diff) | |
| download | vcpkg-d15818c602e4031cb9ba6cf622182ca6e90f40ba.tar.gz vcpkg-d15818c602e4031cb9ba6cf622182ca6e90f40ba.zip | |
Checks::unreachable() now needs LineInfo as an argument
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/PostBuildLint.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_build.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_ci.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_install.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/commands_integrate.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 6 | ||||
| -rw-r--r-- | toolsrc/src/package_spec_parse_result.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Checks.cpp | 4 |
8 files changed, 14 insertions, 12 deletions
diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 8abf71bb3..3df237b2d 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -693,7 +693,7 @@ namespace vcpkg::PostBuildLint } case LinkageType::backing_enum_t::NULLVALUE: default: - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } error_count += check_no_empty_folders(package_dir); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index a47083cbd..ac2a9c53d 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -101,7 +101,7 @@ namespace vcpkg::Commands::Build case BuildResult::BUILD_FAILED: return BUILD_FAILED_STRING; case BuildResult::POST_BUILD_CHECKS_FAILED: return POST_BUILD_CHECKS_FAILED_STRING; case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; - default: Checks::unreachable(); + default: Checks::unreachable(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 315308a62..f5df41ace 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -81,7 +81,7 @@ namespace vcpkg::Commands::CI System::println(System::color::success, "Package %s is installed from cache", action.spec); } else - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } catch (const std::exception& e) { diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index bb3df943c..61e46b604 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -170,7 +170,7 @@ namespace vcpkg::Commands::Install { if (status_db->find_installed(dep, spgh.package.spec.target_triplet()) == status_db->end()) { - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } } write_update(paths, spgh); @@ -233,7 +233,7 @@ namespace vcpkg::Commands::Install System::println(System::color::success, "Package %s is installed", action.spec); } else - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } catch (const std::exception& e) { diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index f98b9f77c..ccc2a46b2 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -156,7 +156,7 @@ namespace vcpkg::Commands::Integrate System::println(System::color::warning, "Warning: Previous integration file was not removed"); exit(EXIT_FAILURE); default: - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } } } @@ -195,7 +195,7 @@ namespace vcpkg::Commands::Integrate System::println(System::color::warning, "Warning: integration was not applied"); exit(EXIT_FAILURE); default: - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } Checks::check_exit(fs::exists(system_wide_targets_file), "Error: failed to copy targets file to %s", system_wide_targets_file.string()); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 1b7b7923a..54ed201d0 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -129,7 +129,7 @@ namespace vcpkg::Commands::Remove continue; } - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } if (!not_installed.empty()) @@ -158,7 +158,7 @@ namespace vcpkg::Commands::Remove return " " + p->spec.toString(); } - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); })); } } @@ -208,7 +208,7 @@ namespace vcpkg::Commands::Remove break; case remove_plan_type::UNKNOWN: default: - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } if (alsoRemoveFolderFromPackages) diff --git a/toolsrc/src/package_spec_parse_result.cpp b/toolsrc/src/package_spec_parse_result.cpp index 892232c2e..fc92cf2ff 100644 --- a/toolsrc/src/package_spec_parse_result.cpp +++ b/toolsrc/src/package_spec_parse_result.cpp @@ -20,7 +20,7 @@ namespace vcpkg case package_spec_parse_result::INVALID_CHARACTERS: return "Contains invalid characters. Only alphanumeric lowercase ASCII characters and dashes are allowed"; default: - Checks::unreachable(); + Checks::unreachable(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index caffb1a8f..95ef7c60f 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "vcpkg_Checks.h" #include "vcpkg_System.h" +#include "vcpkglib.h" namespace vcpkg { @@ -12,9 +13,10 @@ namespace vcpkg namespace vcpkg::Checks { - __declspec(noreturn) void unreachable() + __declspec(noreturn) void unreachable(const LineInfo& line_info) { System::println(System::color::error, "Error: Unreachable code was reached"); + System::println(System::color::error, line_info.toString()); // Always print line_info here #ifndef NDEBUG std::abort(); #else |
