added deprecated flag into ProtobufCFieldDescriptor->flags

[edmonds@fsi.io: resolve merge conflicts, add documentation]
This commit is contained in:
Andrei Nigmatulin 2014-04-02 00:57:13 +01:00 committed by Robert Edmonds
parent 8a71fdab60
commit e962705437
2 changed files with 7 additions and 1 deletions

View File

@ -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.

View File

@ -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"