build: Remove dependencies on fmtlib
With C++23, we can replace fmt::format with std::format and fmt::print
with stdplus::print. This allows us to migrate to std::print once the
support is available.
Change-Id: I790901fb3b96d815275a3919e1fb90973189fc02
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/subprojects/dhcp-done/dhcp-done.cpp b/subprojects/dhcp-done/dhcp-done.cpp
index 00c0e3b..d6c5c96 100644
--- a/subprojects/dhcp-done/dhcp-done.cpp
+++ b/subprojects/dhcp-done/dhcp-done.cpp
@@ -12,12 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <fmt/format.h>
-
#include <sdeventplus/event.hpp>
#include <sdeventplus/source/io.hpp>
#include <stdplus/fd/create.hpp>
#include <stdplus/fd/ops.hpp>
+#include <stdplus/print.hpp>
using namespace std::string_view_literals;
@@ -48,7 +47,7 @@
{
if (argc != 2)
{
- fmt::print(stderr, "Invalid parameter count\n");
+ stdplus::println(stderr, "Invalid parameter count");
return 1;
}
@@ -64,7 +63,7 @@
}
else
{
- fmt::print(stderr, "Invalid parameter\n");
+ stdplus::println(stderr, "Invalid parameter");
return 1;
}
@@ -84,7 +83,7 @@
}
catch (const std::exception& e)
{
- fmt::print(stderr, "Failed: {}\n", e.what());
+ stdplus::println(stderr, "Failed: {}", e.what());
return 1;
}
}