fix build against protobuf v34+#223
Conversation
Upstream protobuf changed StringViewArg from const std::string& to absl::string_view: protocolbuffers/protobuf@aeb5f2d By using the same StringViewArg alias they use in their declarations, we can fix the build against protobuf v34+ without losing support for older versions. We get new warnings, because this alias is deprecated, but I think that's better than bumping the required protobuf version unnecessarily. This approach can always be revisited if they fully drop StringViewArg in the future. Tested against protobuf v32.1 and v34.1.
|
missing include header to get the definition of aka EDIT: seems more complicated since header is already included above... Please also note the using is |
|
Weird, builds OK on my setup, are you on a slightly different protobuf version than me? The header is included above as you noted so I don't think it's that.
I think the public inheritance on DescriptorDatabase here is what makes the StringViewArg using still available. |
Upstream protobuf changed StringViewArg from const std::string& to absl::string_view: protocolbuffers/protobuf@aeb5f2d
By using the same StringViewArg alias they use in their declarations, we can fix the build against protobuf v34+ without losing support for older versions.
We get new warnings, because this alias is deprecated, but I think that's better than bumping the required protobuf version unnecessarily. This approach can always be revisited if they fully drop StringViewArg in the future.
Tested against protobuf v32.1 and v34.1.