Skip to content

Commit

Permalink
Update the return type of the version helper
Browse files Browse the repository at this point in the history
Also update the callsite, so there are no problems with scope of
objects.

Bug: 393455992
  • Loading branch information
cjreynol committed Jan 31, 2025
1 parent a4edaef commit 4ae6404
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions base/cvd/build_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
#ifndef BUILD_VERSION_H
#define BUILD_VERSION_H

#include <string_view>
#include <string>

namespace android {
namespace build {

inline std::string_view GetBuildNumber() {
static constexpr char kBuildNumber[] = "@VCS_TAG@";
return kBuildNumber;
std::string GetBuildNumber() {
return "@VCS_TAG@";
}

} // namespace build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CvdVersionHandler : public CvdCommandHandler {
fmt::print(std::cout, "major: {}\n", cvd::kVersionMajor);
fmt::print(std::cout, "minor: {}\n", cvd::kVersionMinor);

std::string_view build = android::build::GetBuildNumber();
const std::string build = android::build::GetBuildNumber();
if (!build.empty()) {
fmt::print(std::cout, "build: {}\n", build);
}
Expand Down

0 comments on commit 4ae6404

Please sign in to comment.