Commit e9627054 authored by Andrei Nigmatulin's avatar Andrei Nigmatulin Committed by Robert Edmonds

added deprecated flag into ProtobufCFieldDescriptor->flags

[edmonds@fsi.io: resolve merge conflicts, add documentation]
parent 8a71fdab
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment