Skip to content

Commit c37ba1f

Browse files
committed
Remove version-related fmtlib workarounds
fmtlib is now up to date in all places that build our source code. Bug: b/445234045
1 parent 2974b15 commit c37ba1f

File tree

4 files changed

+3
-24
lines changed

4 files changed

+3
-24
lines changed

base/cvd/cuttlefish/common/libs/utils/result.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@
2727
#include <android-base/logging.h>
2828
#include <android-base/result.h> // IWYU pragma: export
2929

30-
#if FMT_VERSION < 80000
31-
namespace fmt {
32-
// fmt::runtime was added in v8.0.0
33-
template<typename T>
34-
const T& runtime(const T& param) {
35-
return param;
36-
}
37-
}
38-
#endif
39-
4030
namespace cuttlefish {
4131

4232
class StackTraceError;

base/cvd/cuttlefish/host/libs/config/external_network_mode.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,5 @@ Result<ExternalNetworkMode> ParseExternalNetworkMode(std::string_view);
3535

3636
} // namespace cuttlefish
3737

38-
#if FMT_VERSION >= 90000
3938
template <>
4039
struct fmt::formatter<cuttlefish::ExternalNetworkMode> : ostream_formatter {};
41-
#endif

base/cvd/cuttlefish/host/libs/config/vmm_mode.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,5 @@ Result<VmmMode> ParseVmm(std::string_view);
3838

3939
} // namespace cuttlefish
4040

41-
#if FMT_VERSION >= 90000
4241
template <>
4342
struct fmt::formatter<cuttlefish::VmmMode> : ostream_formatter {};
44-
#endif

base/cvd/cuttlefish/host/libs/web/chrome_os_build_string.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323

2424
#include <fmt/format.h>
2525

26-
#ifndef CONST_IF_LATER_FMTLIB
27-
#if FMT_VERSION >= 90000
28-
#define CONST_IF_LATER_FMTLIB const
29-
#else
30-
#define CONST_IF_LATER_FMTLIB
31-
#endif
32-
#endif
3326
#include "cuttlefish/common/libs/utils/flag_parser.h"
3427

3528
namespace cuttlefish {
@@ -56,7 +49,7 @@ struct fmt::formatter<cuttlefish::ChromeOsBuilder>
5649
: formatter<std::string_view> {
5750
template <typename FormatContext>
5851
auto format(const cuttlefish::ChromeOsBuilder& cob,
59-
FormatContext& ctx) CONST_IF_LATER_FMTLIB {
52+
FormatContext& ctx) const {
6053
auto formatted =
6154
fmt::format("{}/{}/{}", cob.project, cob.bucket, cob.builder);
6255
return formatter<std::string_view>::format(formatted, ctx);
@@ -68,7 +61,7 @@ struct fmt::formatter<cuttlefish::ChromeOsBuildString>
6861
: formatter<std::string_view> {
6962
template <typename FormatContext>
7063
auto format(const cuttlefish::ChromeOsBuildString& cobs,
71-
FormatContext& ctx) CONST_IF_LATER_FMTLIB {
64+
FormatContext& ctx) const {
7265
auto formatted =
7366
std::visit([](auto&& value) { return fmt::format("{}", value); }, cobs);
7467
return formatter<std::string_view>::format(formatted, ctx);
@@ -80,7 +73,7 @@ struct fmt::formatter<std::optional<cuttlefish::ChromeOsBuildString>>
8073
: formatter<std::string_view> {
8174
template <typename FormatContext>
8275
auto format(const std::optional<cuttlefish::ChromeOsBuildString>& cobs,
83-
FormatContext& ctx) CONST_IF_LATER_FMTLIB {
76+
FormatContext& ctx) const {
8477
auto formatted = cobs ? fmt::format("{}", *cobs) : "";
8578
return formatter<std::string_view>::format(formatted, ctx);
8679
}

0 commit comments

Comments
 (0)