Skip to content

Commit 0c4d799

Browse files
committed
patches/extras: Fix incompatibility with protobuf v30
1 parent 873fb25 commit 0c4d799

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 36c605004ae1c75813181ffe4c59907016aaf9e9 Mon Sep 17 00:00:00 2001
2+
From: Biswapriyo Nath <nathbappai@gmail.com>
3+
Date: Tue, 22 Apr 2025 15:12:23 +0000
4+
Subject: [PATCH] extras/libjsonpb: Fix incompatibility with protobuf v30
5+
6+
This commit fixes the following compiler error.
7+
8+
jsonpb.cpp:36:44: error: invalid operands to binary expression (
9+
'basic_string<char, char_traits<char>, allocator<char>>' and
10+
'internal::DescriptorStringView' (aka 'basic_string_view<char>'))
11+
36 | return std::string(kTypeUrlPrefix) + "/" + message.GetDescriptor()->full_name();
12+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13+
14+
More info here https://protobuf.dev/news/2024-10-02/#descriptor-apis
15+
16+
Change-Id: I3c76d51dfdfbe013eaa5031e6194bf5edae1be35
17+
---
18+
libjsonpb/parse/jsonpb.cpp | 2 +-
19+
1 file changed, 1 insertion(+), 1 deletion(-)
20+
21+
diff --git a/libjsonpb/parse/jsonpb.cpp b/libjsonpb/parse/jsonpb.cpp
22+
index b342c2b..ebd71bf 100644
23+
--- a/libjsonpb/parse/jsonpb.cpp
24+
+++ b/libjsonpb/parse/jsonpb.cpp
25+
@@ -33,7 +33,7 @@ using google::protobuf::util::TypeResolver;
26+
static constexpr char kTypeUrlPrefix[] = "type.googleapis.com";
27+
28+
std::string GetTypeUrl(const Message& message) {
29+
- return std::string(kTypeUrlPrefix) + "/" + message.GetDescriptor()->full_name();
30+
+ return std::string(kTypeUrlPrefix) + "/" + std::string(message.GetDescriptor()->full_name());
31+
}
32+
33+
ErrorOr<std::string> MessageToJsonString(const Message& message) {
34+
--
35+
2.49.0
36+

0 commit comments

Comments
 (0)