GCC doesn't implement <format> yet, use fmt

This commit is contained in:
Dan Paulat 2023-04-17 18:24:50 -05:00
parent 593010acc2
commit 31db9a4315
12 changed files with 27 additions and 28 deletions

View file

@ -1,6 +1,6 @@
#include <scwx/qt/util/color.hpp>
#include <format>
#include <fmt/format.h>
#include <QColor>
namespace scwx
@ -16,7 +16,7 @@ static const std::string logPrefix_ = "scwx::qt::util::color";
std::string ToArgbString(const boost::gil::rgba8_pixel_t& color)
{
return std::format(
return fmt::format(
"#{:02x}{:02x}{:02x}{:02x}", color[3], color[0], color[1], color[2]);
}

View file

@ -13,6 +13,7 @@
#include <unordered_map>
#include <boost/timer/timer.hpp>
#include <fmt/format.h>
#include <imgui.h>
#include <QFile>
#include <QFileInfo>
@ -273,7 +274,7 @@ void FontImpl::CreateImGuiFont(QFile& fontFile,
// Assign name to font
strncpy(fontConfig.Name,
std::format("{}:{}", fileInfo.fileName().toStdString(), fontSize)
fmt::format("{}:{}", fileInfo.fileName().toStdString(), fontSize)
.c_str(),
sizeof(fontConfig.Name));
fontConfig.Name[sizeof(fontConfig.Name) - 1] = 0;