Remove Enums::unreachable(). Use Checks::unreachable() instead
MODIFY
include/vcpkg_Enums.h
include/vcpkg_Enums.h
@@ -6,6 +6,4 @@ namespace vcpkg::Enums
std::string nullvalue_toString(const std::string& enum_name);
__declspec(noreturn) void nullvalue_used(const std::string& enum_name);
-
- __declspec(noreturn) void unreachable(const std::string& enum_name);
}

MODIFY
src/PostBuildLint_BuildPolicies.cpp
src/PostBuildLint_BuildPolicies.cpp
#include "pch.h"
#include "PostBuildLint_BuildPolicies.h"
#include "vcpkg_Enums.h"
+#include "vcpkg_Checks.h"
namespace vcpkg::PostBuildLint::BuildPolicies
{
@@ -23,7 +24,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies
case NULLVALUE:
return NULLVALUE_STRING;
default:
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
}
@@ -44,7 +45,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies
case NULLVALUE:
Enums::nullvalue_used(ENUM_NAME);
default:
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
}

MODIFY
src/PostBuildLint_BuildType.cpp
src/PostBuildLint_BuildType.cpp
#include "pch.h"
#include "PostBuildLint_BuildType.h"
-#include "vcpkg_Enums.h"
+#include "vcpkg_Checks.h"
namespace vcpkg::PostBuildLint::BuildType
{
@@ -26,7 +26,7 @@ namespace vcpkg::PostBuildLint::BuildType
return RELEASE_DYNAMIC;
}
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
const ConfigurationType::type& type::config() const
@@ -57,7 +57,7 @@ namespace vcpkg::PostBuildLint::BuildType
case BuildType::RELEASE_DYNAMIC:
return REGEX_RELEASE_DYNAMIC;
default:
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
}
@@ -79,7 +79,7 @@ namespace vcpkg::PostBuildLint::BuildType
case BuildType::RELEASE_DYNAMIC:
return NAME_RELEASE_DYNAMIC;
default:
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
}
}

MODIFY
src/PostBuildLint_ConfigurationType.cpp
src/PostBuildLint_ConfigurationType.cpp
#include "pch.h"
#include "PostBuildLint_ConfigurationType.h"
#include "vcpkg_Enums.h"
+#include "package_spec.h"
namespace vcpkg::PostBuildLint::ConfigurationType
{
@@ -20,7 +21,7 @@ namespace vcpkg::PostBuildLint::ConfigurationType
case ConfigurationType::NULLVALUE:
return NULLVALUE_STRING;
default:
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
}
}

MODIFY
src/PostBuildLint_LinkageType.cpp
src/PostBuildLint_LinkageType.cpp
#include "pch.h"
#include "PostBuildLint_LinkageType.h"
#include "vcpkg_Enums.h"
+#include "vcpkg_Checks.h"
namespace vcpkg::PostBuildLint::LinkageType
{
@@ -20,7 +21,7 @@ namespace vcpkg::PostBuildLint::LinkageType
case LinkageType::NULLVALUE:
return NULLVALUE_STRING;
default:
- Enums::unreachable(ENUM_NAME);
+ Checks::unreachable(VCPKG_LINE_INFO);
}
}

MODIFY
src/vcpkg_Enums.cpp
src/vcpkg_Enums.cpp
@@ -13,9 +13,4 @@ namespace vcpkg::Enums
{
Checks::exit_with_message("NULLVALUE of enum %s was used", enum_name);
}
-
- __declspec(noreturn) void unreachable(const std::string& enum_name)
- {
- Checks::exit_with_message("Unreachable code for enum, %s", enum_name);
- }
}

Remove Enums::unreachable(). Use Checks::unreachable() instead