1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Corrected build issues with GCC 13

This commit is contained in:
WerWolv 2023-05-06 10:07:22 +02:00
parent 82f5900759
commit 2d1381860d
3 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,8 @@
#include <string>
#include <string_view>
#include <fmt/format.h>
namespace hex {
class LanguageDefinition {
@ -56,4 +58,12 @@ namespace hex {
return LangEntry(string);
}
}
}
template<>
struct fmt::formatter<hex::LangEntry> : fmt::formatter<std::string_view> {
template<typename FormatContext>
auto format(const hex::LangEntry &entry, FormatContext &ctx) {
return fmt::formatter<std::string_view>::format(entry, ctx);
}
};

View File

@ -17,7 +17,7 @@ namespace hex::log {
namespace {
[[maybe_unused]] void printPrefix(FILE *dest, const fmt::text_style &ts, const std::string &level) {
const auto now = fmt::localtime(std::chrono::system_clock::now());
const auto now = fmt::localtime(std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()));
fmt::print(dest, "[{0:%H:%M:%S}] ", now);

View File

@ -24,7 +24,7 @@ namespace hex::log {
for (const auto &path : fs::getDefaultPaths(fs::ImHexPath::Logs, true)) {
wolv::io::fs::createDirectories(path);
g_loggerFile = wolv::io::File(path / hex::format("{0:%Y%m%d_%H%M%S}.log", fmt::localtime(std::chrono::system_clock::now())), wolv::io::File::Mode::Create);
g_loggerFile = wolv::io::File(path / hex::format("{0:%Y%m%d_%H%M%S}.log", fmt::localtime(std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()))), wolv::io::File::Mode::Create);
g_loggerFile.disableBuffering();
if (g_loggerFile.isValid()) break;