remove use of fmt
All uses of fmt can be replaced with either std::format directly
or a tentative implementation of std::print (which we can use
until GCC supports std::print). Remove the extra dependency.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I466497695a6d53b7767a6456bebe165c5a75121a
diff --git a/src/cmd.cpp b/src/cmd.cpp
index 4d0dec8..a3c9d3f 100644
--- a/src/cmd.cpp
+++ b/src/cmd.cpp
@@ -1,6 +1,6 @@
#include "cmd.hpp"
-#include <fmt/format.h>
+#include "print.hpp"
#include <sdbusplus/bus.hpp>
#include <sdbusplus/exception.hpp>
@@ -10,6 +10,8 @@
#include <stdplus/fd/ops.hpp>
#include <array>
+#include <cstdio>
+#include <format>
#include <map>
#include <span>
#include <stdexcept>
@@ -45,7 +47,7 @@
// netfn needs to be changed to odd in KCS responses
if (data.size() + 3 > buffer.size())
{
- throw std::runtime_error(fmt::format(
+ throw std::runtime_error(std::format(
"too large {} > {}", data.size() + 3, buffer.size()));
}
buffer[0] = (netfn | 1) << 2;
@@ -57,7 +59,7 @@
}
catch (const std::exception& e)
{
- fmt::print(stderr, "IPMI response failure: {}\n", e.what());
+ std::print(stderr, "IPMI response failure: {}\n", e.what());
buffer[0] |= 1 << 2;
buffer[2] = 0xff;
}
@@ -74,12 +76,12 @@
}
if (outstanding)
{
- fmt::print(stderr, "Canceling outstanding request\n");
+ std::print(stderr, "Canceling outstanding request\n");
outstanding = slot_t(nullptr);
}
if (in.size() < 2)
{
- fmt::print(stderr, "Read too small, ignoring\n");
+ std::print(stderr, "Read too small, ignoring\n");
return;
}
auto m = bus.new_method_call("xyz.openbmc_project.Ipmi.Host",