aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-03-22 17:08:59 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-03-22 17:18:01 -0700
commit197d471b42dcffa15e254ec38c654d33f1f050fe (patch)
treeff586d5e860b711040767e1ee94700ace9213817 /toolsrc/include
parent5c504265f36d04d6a9bd04e049d0ee53639c8b21 (diff)
downloadvcpkg-197d471b42dcffa15e254ec38c654d33f1f050fe.tar.gz
vcpkg-197d471b42dcffa15e254ec38c654d33f1f050fe.zip
Introduce Checks::exit_with_code() and exit_fail()/exit_success()
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg_Checks.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h
index 47662637f..336462e54 100644
--- a/toolsrc/include/vcpkg_Checks.h
+++ b/toolsrc/include/vcpkg_Checks.h
@@ -7,6 +7,18 @@ namespace vcpkg::Checks
{
__declspec(noreturn) void unreachable(const LineInfo& line_info);
+ _declspec(noreturn) void exit_with_code(const LineInfo& line_info, const int exit_code);
+
+ _declspec(noreturn) inline void exit_fail(const LineInfo& line_info)
+ {
+ return exit_with_code(line_info, EXIT_FAILURE);
+ }
+
+ _declspec(noreturn) inline void exit_success(const LineInfo& line_info)
+ {
+ return exit_with_code(line_info, EXIT_SUCCESS);
+ }
+
// Part of the reason these exist is to not include extra headers in this one to avoid circular #includes.
_declspec(noreturn) void exit_with_message(const LineInfo& line_info, const char* errorMessage);