Unverified Commit 46a22f4d authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

avro-cpp: fix build with fmt 11 (#452150)

parents b439cfe1 6af2f8a9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
diff --git a/include/avro/Node.hh b/include/avro/Node.hh
--- a/include/avro/Node.hh
+++ b/include/avro/Node.hh
@@ -219,7 +219,7 @@ template<>
 struct fmt::formatter<avro::Name> : fmt::formatter<std::string> {
     template<typename FormatContext>
-    auto format(const avro::Name &n, FormatContext &ctx) {
+    auto format(const avro::Name &n, FormatContext &ctx) const {
         return fmt::formatter<std::string>::format(n.fullname(), ctx);
     }
 };
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
diff --git a/include/avro/Types.hh b/include/avro/Types.hh
--- a/include/avro/Types.hh
+++ b/include/avro/Types.hh
@@ -113,7 +113,7 @@ template<>
 struct fmt::formatter<avro::Type> : fmt::formatter<std::string> {
     template<typename FormatContext>
-    auto format(avro::Type t, FormatContext &ctx) {
+    auto format(avro::Type t, FormatContext &ctx) const {
         return fmt::formatter<std::string>::format(avro::toString(t), ctx);
     }
 };
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -18,8 +18,12 @@ stdenv.mkDerivation rec {
    hash = "sha256-8u33cSanWw7BrRZncr4Fg1HOo9dESL5+LO8gBQwPmKs=";
  };

  # TODO: remove fmt formatter patches when updating to next version
  # Patches exist upstream but don't apply cleanly.
  patches = [
    ./0001-get-rid-of-fmt-fetchcontent.patch
    ./0002-fix-fmt-name-formatter.patch
    ./0003-fix-fmt-type-formatter.patch
  ];

  nativeBuildInputs = [