mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-26 21:04:23 +08:00
protoc-c/c_helpers.h: Remove HAVE_PROTO3 conditional
This commit is contained in:
parent
7ed03a715b
commit
e08fe62565
@ -175,15 +175,11 @@ int compare_name_indices_by_name(const void*, const void*);
|
|||||||
// Return the syntax version of the file containing the field.
|
// Return the syntax version of the file containing the field.
|
||||||
// This wrapper is needed to be able to compile against protobuf2.
|
// This wrapper is needed to be able to compile against protobuf2.
|
||||||
inline int FieldSyntax(const FieldDescriptor* field) {
|
inline int FieldSyntax(const FieldDescriptor* field) {
|
||||||
#ifdef HAVE_PROTO3
|
|
||||||
#if GOOGLE_PROTOBUF_VERSION >= 4023000
|
#if GOOGLE_PROTOBUF_VERSION >= 4023000
|
||||||
return FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3 ? 3 : 2;
|
return FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3 ? 3 : 2;
|
||||||
#else
|
#else
|
||||||
return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2;
|
return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2;
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
return 2;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work around changes in protobuf >= 22.x without breaking compilation against
|
// Work around changes in protobuf >= 22.x without breaking compilation against
|
||||||
|
Loading…
x
Reference in New Issue
Block a user