Use reserved word in string within descriptor (from Andrei Nigmatulin).

git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@193 00440858-1255-0410-a3e6-75ea37f81c3a
This commit is contained in:
lahiker42 2009-10-18 15:50:40 +00:00
parent eeed9c2b7a
commit aab90f4a32
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
0.12 [NOT YET RELEASED]
- for field names which are reserved words, use the real name
given in the protobuf-c file, not the mangled name which
is the name of the member in the C structure. (Andrei Nigmatulin)
0.11:
- allow CFLAGS=-DPRINT_UNPACK_ERRORS=0 to suppress
unpack warnings from being printed at compile time (Andrei Nigmatulin)

View File

@ -50,6 +50,7 @@ void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer,
variables["TYPE"] = type_macro;
variables["classname"] = FullNameToC(FieldScope(descriptor_)->full_name());
variables["name"] = FieldName(descriptor_);
variables["proto_name"] = descriptor_->name();
variables["descriptor_addr"] = descriptor_addr;
variables["value"] = SimpleItoa(descriptor_->number());
@ -63,7 +64,7 @@ void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer,
printer->Print(variables,
"{\n"
" \"$name$\",\n"
" \"$proto_name$\",\n"
" $value$,\n"
" PROTOBUF_C_LABEL_$LABEL$,\n"
" PROTOBUF_C_TYPE_$TYPE$,\n");