aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-03-13 16:04:29 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-03-13 16:04:29 -0700
commite3bba294b4b08887851382573a7f2c73545e85fb (patch)
treec71f8ddae944a5c5b43eca18fedc5919122d2e84 /toolsrc/include
parenta1d38868ab2998f07cc0f44fa1f747fe0cb7d5bb (diff)
downloadvcpkg-e3bba294b4b08887851382573a7f2c73545e85fb.tar.gz
vcpkg-e3bba294b4b08887851382573a7f2c73545e85fb.zip
Introduce LINE_INFO macro + struct
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg_Checks.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h
index 23869f35f..c9293b0bb 100644
--- a/toolsrc/include/vcpkg_Checks.h
+++ b/toolsrc/include/vcpkg_Checks.h
@@ -2,6 +2,22 @@
#include "vcpkg_Strings.h"
+namespace vcpkg
+{
+ struct LineInfo
+ {
+ int line_number;
+ const char* file_name;
+
+ constexpr LineInfo() : line_number(0), file_name(nullptr) {}
+ constexpr LineInfo(const int line_number, const char* file_name) : line_number(line_number), file_name(file_name) {}
+
+ std::string toString() const;
+ };
+}
+
+#define LINE_INFO vcpkg::LineInfo(__LINE__, __FILE__)
+
namespace vcpkg::Checks
{
__declspec(noreturn) void unreachable();