Add yaze_config.h for version management and update version check logic
This commit is contained in:
@@ -361,17 +361,5 @@ void ApplyBpsPatch(const std::vector<uint8_t> &source,
|
||||
}
|
||||
}
|
||||
|
||||
absl::StatusOr<std::string> CheckVersion(const char *version) {
|
||||
std::string version_string = version;
|
||||
if (version_string != kYazeVersion) {
|
||||
std::string message =
|
||||
absl::StrFormat("Yaze version mismatch: expected %s, got %s",
|
||||
kYazeVersion.data(), version_string.c_str());
|
||||
return absl::InvalidArgumentError(message);
|
||||
}
|
||||
return version_string;
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace yaze
|
||||
|
||||
@@ -313,12 +313,7 @@ void ApplyBpsPatch(const std::vector<uint8_t> &source,
|
||||
const std::vector<uint8_t> &patch,
|
||||
std::vector<uint8_t> &target);
|
||||
|
||||
constexpr std::string_view kYazeVersion = "0.2.1";
|
||||
|
||||
absl::StatusOr<std::string> CheckVersion(const char *version);
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace yaze
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user