mirror of https://github.com/qt/qtgrpc.git
Remove call to protobuf FileDescriptor::syntax()
In the new version of protobuf FileDescriptor::syntax() should not be used. Instead, protobuf API should be working with both, proto2 and proto3 syntax. Task-number: QTBUG-114833 Task-number: QTBUG-114962 Pick-to: 6.6 Change-Id: I86542cfcc0cc247f1e75e6d711e269ff3537f8a4 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
parent
e66b3ac4c8
commit
2297f2da52
|
|
@ -30,13 +30,9 @@ QGrpcGenerator::~QGrpcGenerator() = default;
|
||||||
bool QGrpcGenerator::Generate(const FileDescriptor *file,
|
bool QGrpcGenerator::Generate(const FileDescriptor *file,
|
||||||
[[maybe_unused]] const std::string ¶meter,
|
[[maybe_unused]] const std::string ¶meter,
|
||||||
GeneratorContext *generatorContext,
|
GeneratorContext *generatorContext,
|
||||||
std::string *error) const
|
[[maybe_unused]] std::string *error) const
|
||||||
{
|
{
|
||||||
assert(file != nullptr && generatorContext != nullptr);
|
assert(file != nullptr && generatorContext != nullptr);
|
||||||
if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) {
|
|
||||||
*error = "Invalid proto used. qtgrpcgen only supports 'proto3' syntax";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return GenerateClientServices(file, generatorContext);
|
return GenerateClientServices(file, generatorContext);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,16 +36,11 @@ QProtobufGenerator::~QProtobufGenerator() = default;
|
||||||
bool QProtobufGenerator::Generate(const FileDescriptor *file,
|
bool QProtobufGenerator::Generate(const FileDescriptor *file,
|
||||||
[[maybe_unused]] const std::string ¶meter,
|
[[maybe_unused]] const std::string ¶meter,
|
||||||
GeneratorContext *generatorContext,
|
GeneratorContext *generatorContext,
|
||||||
std::string *error) const
|
[[maybe_unused]] std::string *error) const
|
||||||
{
|
{
|
||||||
assert(file != nullptr);
|
assert(file != nullptr);
|
||||||
assert(generatorContext != nullptr);
|
assert(generatorContext != nullptr);
|
||||||
|
|
||||||
if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) {
|
|
||||||
*error = "Invalid proto used. qtprotobufgen only supports 'proto3' syntax";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return GenerateMessages(file, generatorContext);
|
return GenerateMessages(file, generatorContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue