diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dd8c7b9646c64358ccac3eee992ba21eb8c9bdd..5ea946c177a7bc2dbfbab15d3817ce2cf7a08c53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,8 @@ project( VERSION 0.3.6 LANGUAGES C CXX ) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) # Set default build type and also populate a list of available options get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) @@ -83,9 +85,6 @@ set(CMAKE_SHARED_LINKER_FLAGS_ASAN set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS Debug) set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS ASan) -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - message(STATUS "[${PROJECT_NAME}] Project version: ${PROJECT_VERSION}") configure_file(src/version.hpp.in src/version.hpp) @@ -214,7 +213,7 @@ message(STATUS "[${PROJECT_NAME}] Downloading and building {fmt}") FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt - GIT_TAG d141cdbeb0fb422a3fb7173b285fd38e0d1772dc # v8.0.1 + GIT_TAG 10.2.1 GIT_SHALLOW ON GIT_PROGRESS ON ) @@ -227,7 +226,7 @@ message(STATUS "[${PROJECT_NAME}] Downloading and building spdlog") FetchContent_Declare( spdlog GIT_REPOSITORY https://github.com/gabime/spdlog - GIT_TAG eb3220622e73a4889eee355ffa37972b3cac3df5 # v1.9.2 + GIT_TAG v1.14.0 GIT_SHALLOW ON GIT_PROGRESS ON ) diff --git a/lib/fmt_formatters.hpp b/lib/fmt_formatters.hpp index b57d5b1247a4e811eab06cc508ab7a64a2dac792..7ab61be285a7b488bfd216e03c2c598f399b436b 100644 --- a/lib/fmt_formatters.hpp +++ b/lib/fmt_formatters.hpp @@ -29,9 +29,15 @@ #include #include #include +#include #include +#include +#include +#include #include "cargo/error.hpp" + + namespace cargo { class dataset; @@ -44,7 +50,7 @@ struct fmt::formatter : formatter { template 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::format(str, ctx); } }; diff --git a/src/logger/logger.hpp b/src/logger/logger.hpp index 891be9c9bdd6d8012fd7e4af050383ab102e7f70..8f8bb35d88b86c8584a6ba29b5af345d5c7775cc 100644 --- a/src/logger/logger.hpp +++ b/src/logger/logger.hpp @@ -25,9 +25,12 @@ #ifndef LOGGER_HPP #define LOGGER_HPP +#include #include +#include +#include #include -#include + #include #include diff --git a/src/net/server.cpp b/src/net/server.cpp index 2bcade2b7c73ff18ffb1b895df40dd17b0730551..263cfd97062e83c75e4b704147040a87ee8c3161 100644 --- a/src/net/server.cpp +++ b/src/net/server.cpp @@ -31,7 +31,7 @@ #include #include #include -#include + #include #include "signal_listener.hpp" diff --git a/src/net/utilities.hpp b/src/net/utilities.hpp index 4e01d71e67dd950edeb2e839f468e54c9726f61d..42d505bafb98688182b5072329ed54e789cda61b 100644 --- a/src/net/utilities.hpp +++ b/src/net/utilities.hpp @@ -33,6 +33,10 @@ #include #include #include +#include +#include +#include +#include namespace network { @@ -114,22 +118,22 @@ struct fmt::formatter { } if(it != end && *it != '}') { - ctx.on_error("invalid format"); + format_error("invalid format"); } return it; } template - 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())); } }; diff --git a/src/parallel_request.hpp b/src/parallel_request.hpp index 41f271faebdf48809322c9bc289a0692aa68be83..441389434b912acd301ff244e89ed7dfc79f6331 100644 --- a/src/parallel_request.hpp +++ b/src/parallel_request.hpp @@ -141,7 +141,7 @@ struct fmt::formatter : formatter { }; const auto str = fmt::format("{{state: {}, bw: {}, error_code: {}}}", - state_name(s), s.bw(), s.error()); + state_name(s), s.bw(), *s.error()); return formatter::format(str, ctx); } }; diff --git a/src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp b/src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp index 87b7e9ac728997da523e543a554370a47fb0cc8a..aff3eacfe00782ff02638b3450bf79774afb72b1 100644 --- a/src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp +++ b/src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp @@ -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); }