Apply the fix from #811 to make everything build against Protobuf 31.

This commit is contained in:
David Given
2025-08-19 23:28:19 +02:00
parent b26735d520
commit d1524f78fb
2 changed files with 5 additions and 4 deletions

View File

@@ -439,7 +439,7 @@ std::string ProtoField::get() const
case google::protobuf::FieldDescriptor::TYPE_ENUM: case google::protobuf::FieldDescriptor::TYPE_ENUM:
{ {
const auto* enumvalue = reflection->GetEnum(*_message, _field); const auto* enumvalue = reflection->GetEnum(*_message, _field);
return enumvalue->name(); return (std::string)enumvalue->name();
} }
case google::protobuf::FieldDescriptor::TYPE_MESSAGE: case google::protobuf::FieldDescriptor::TYPE_MESSAGE:
@@ -534,7 +534,7 @@ findAllPossibleProtoFields(const google::protobuf::Descriptor* descriptor)
for (int i = 0; i < d->field_count(); i++) for (int i = 0; i < d->field_count(); i++)
{ {
const google::protobuf::FieldDescriptor* f = d->field(i); const google::protobuf::FieldDescriptor* f = d->field(i);
std::string n = s + f->name(); std::string n = s + (std::string)f->name();
if (f->label() == google::protobuf::FieldDescriptor::LABEL_REPEATED) if (f->label() == google::protobuf::FieldDescriptor::LABEL_REPEATED)
n += "[]"; n += "[]";

View File

@@ -19,7 +19,7 @@ static std::string supportStatus(SupportStatus status)
return ""; return "";
} }
return ""; return "";
} }
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
@@ -43,7 +43,8 @@ int main(int argc, const char* argv[])
{ {
const auto* descriptor = const auto* descriptor =
FilesystemProto::FilesystemType_descriptor(); FilesystemProto::FilesystemType_descriptor();
auto name = descriptor->FindValueByNumber(fs.type())->name(); std::string name =
descriptor->FindValueByNumber(fs.type())->name();
filesystems.insert(name); filesystems.insert(name);
} }