FMT10 support for cargo

Update fmt to v10 to use newer compilers.

Merge request reports

Loading
+7 −1
Changes for lib/fmt_formatters.hpp: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -29,9 +29,15 @@
#include <vector>
#include <string_view>
#include <optional>
#include <filesystem>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/os.h>
#include <fmt/std.h>
#include "cargo/error.hpp"



namespace cargo {

class dataset;
@@ -44,7 +50,7 @@ struct fmt::formatter<cargo::dataset> : formatter<std::string_view> {
    template <typename FormatContext>
    auto
    format(const cargo::dataset& d, FormatContext& ctx) const {
        const auto str = fmt::format("{{path: {}}}", std::quoted(d.path()));
        const auto str = fmt::format("{{path: {:?}}}", d.path());
        return formatter<std::string_view>::format(str, ctx);
    }
};
+4 −1
Changes for src/logger/logger.hpp: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -25,9 +25,12 @@
#ifndef LOGGER_HPP
#define LOGGER_HPP

#include <filesystem>
#include <spdlog/logger.h>
#include <fmt/format.h>
#include <fmt/std.h>
#include <fmt/ostream.h>
#include <filesystem>

#include <optional>
#include <sstream>

+1 −1
Changes for src/net/server.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <filesystem>
#include <string>
#include <system_error>
#include <fmt/format.h>


#include <logger/logger.hpp>
#include "signal_listener.hpp"
+12 −8
Changes for src/net/utilities.hpp: 12 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@
#include <string_view>
#include <atomic>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/os.h>
#include <fmt/std.h>
#include <iomanip>

namespace network {

@@ -114,22 +118,22 @@ struct fmt::formatter<network::rpc_info> {
        }

        if(it != end && *it != '}') {
            ctx.on_error("invalid format");
            format_error("invalid format");
        }

        return it;
    }

    template <typename FormatContext>
    constexpr auto
    auto
    format(const network::rpc_info& rpc, FormatContext& ctx) const {
        format_to(ctx.out(), "{}{} id: {} name: {} ", m_outbound ? "<=" : "=>",
        fmt::format_to(ctx.out(), "{}{} id: {} name: {:?} ", m_outbound ? "<=" : "=>",
                  rpc.pid() ? fmt::format(" pid: {}", *rpc.pid()) : "",
                  rpc.id(), std::quoted(rpc.name()));
        return m_outbound ? format_to(ctx.out(), "to: {}",
                                      std::quoted(rpc.address()))
                          : format_to(ctx.out(), "from: {}",
                                      std::quoted(rpc.address()));
                  rpc.id(), (rpc.name()));
        return m_outbound ? fmt::format_to(ctx.out(), "to: {:?}",
                                      (rpc.address()))
                          : fmt::format_to(ctx.out(), "from: {:?}",
                                      (rpc.address())); 
    }
};

+2 −2
Changes for src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -28,13 +28,13 @@ gekko_plugin::open(const std::string& path, int flags, unsigned int mode) {
// Override the pread function
ssize_t
gekko_plugin::pread(int fd, void* buf, size_t count, off_t offset) {
    return gkfs::syscall::gkfs_pread_ws(fd, buf, count, offset);
    return gkfs::syscall::gkfs_pread(fd, buf, count, offset);
}

// Override the pwrite function
ssize_t
gekko_plugin::pwrite(int fd, const void* buf, size_t count, off_t offset) {
    return gkfs::syscall::gkfs_pwrite_ws(fd, buf, count, offset);
    return gkfs::syscall::gkfs_pwrite(fd, buf, count, offset);
}


Loading
Loading