Introduce LINE_INFO macro + struct
MODIFY
include/vcpkg_Checks.h
include/vcpkg_Checks.h
#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();

MODIFY
src/vcpkg_Checks.cpp
src/vcpkg_Checks.cpp
#include "vcpkg_Checks.h"
#include "vcpkg_System.h"
+namespace vcpkg
+{
+ std::string LineInfo::toString() const
+ {
+ return Strings::format("%s(%d)", this->file_name, this->line_number);
+ }
+}
+
namespace vcpkg::Checks
{
__declspec(noreturn) void unreachable()

Introduce LINE_INFO macro + struct