mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 13:31:02 +08:00
added deprecated flag into ProtobufCFieldDescriptor->flags
[edmonds@fsi.io: resolve merge conflicts, add documentation]
This commit is contained in:
parent
8a71fdab60
commit
e962705437
@ -250,7 +250,10 @@ struct _ProtobufCFieldDescriptor {
|
||||
typedef enum {
|
||||
/* Set if the field is repeated and marked with the 'packed' option. */
|
||||
PROTOBUF_C_FIELD_FLAG_PACKED = (1 << 0),
|
||||
} ProtobufCFieldFlag;
|
||||
|
||||
/* Set if the field is marked with the 'deprecated' option. */
|
||||
PROTOBUF_C_FIELD_FLAG_DEPRECATED = (1 << 1),
|
||||
} ProtobufCFieldFlagType;
|
||||
|
||||
/*
|
||||
* ProtobufCMessageDescriptor: description of a message.
|
||||
|
@ -130,6 +130,9 @@ void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer,
|
||||
&& descriptor_->options().packed())
|
||||
variables["flags"] += " | PROTOBUF_C_FIELD_FLAG_PACKED";
|
||||
|
||||
if (descriptor_->options().deprecated())
|
||||
variables["flags"] += " | PROTOBUF_C_FIELD_FLAG_DEPRECATED";
|
||||
|
||||
printer->Print(variables,
|
||||
"{\n"
|
||||
" \"$proto_name$\",\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user