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/main.cpp b/src/main.cpp
index 6abd949..9d7d99e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,8 +1,8 @@
#include "args.hpp"
#include "cmd.hpp"
+#include "print.hpp"
#include "server.hpp"
-#include <fmt/format.h>
#include <systemd/sd-daemon.h>
#include <sdbusplus/bus.hpp>
@@ -15,6 +15,8 @@
#include <stdplus/signal.hpp>
#include <algorithm>
+#include <cstdio>
+#include <format>
#include <stdexcept>
#include <string>
@@ -36,7 +38,7 @@
// Configure basic signal handling
auto exit_handler = [&event](Signal&, const struct signalfd_siginfo*) {
- fmt::print(stderr, "Interrupted, Exiting\n");
+ std::print(stderr, "Interrupted, Exiting\n");
event.exit(0);
};
stdplus::signal::block(SIGINT);
@@ -46,7 +48,7 @@
// Open an FD for the KCS channel
stdplus::ManagedFd kcs = stdplus::fd::open(
- fmt::format("/dev/{}", channel),
+ std::format("/dev/{}", channel),
OpenFlags(OpenAccess::ReadWrite).set(OpenFlag::NonBlock));
sdbusplus::slot_t slot(nullptr);
@@ -79,7 +81,7 @@
}
catch (const std::exception& e)
{
- fmt::print(stderr, "FAILED: {}\n", e.what());
+ std::print(stderr, "FAILED: {}\n", e.what());
return 1;
}
}