Skip to content

Commit

Permalink
bug userver: fix build on ubuntu 24.04
Browse files Browse the repository at this point in the history
commit_hash:f81e751ac8c83bcfc7e945d5b7cebbf711ef0556
  • Loading branch information
segoon committed Oct 15, 2024
1 parent 24a2d6b commit c9b7274
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CMAKE_COMMON_FLAGS ?= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
CMAKE_DEBUG_FLAGS ?= -DUSERVER_SANITIZE=addr;ub
CMAKE_DEBUG_FLAGS ?= '-DUSERVER_SANITIZE=addr;ub'
CMAKE_RELEASE_FLAGS ?=
KERNEL := $(shell uname -s)
NPROCS ?= $(shell nproc)
Expand Down
14 changes: 14 additions & 0 deletions core/src/components/impl/component_name_from_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,17 @@ struct std::hash<USERVER_NAMESPACE::components::impl::ComponentNameFromInfo> {
return std::hash<std::string_view>{}(v.StringViewName());
}
};

// fmt::format support
template <>
struct fmt::formatter<
USERVER_NAMESPACE::components::impl::ComponentNameFromInfo, char>
: fmt::formatter<std::string_view, char> {
template <typename FormatContext>
auto format(
const USERVER_NAMESPACE::components::impl::ComponentNameFromInfo& v,
FormatContext& ctx) USERVER_FMT_CONST {
return fmt::formatter<std::string_view, char>{}.format(v.StringViewName(),
ctx);
}
};

0 comments on commit c9b7274

Please sign in to comment.