aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs2
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_enum.cc16
2 files changed, 9 insertions, 9 deletions
diff --git a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
index b638dc46..4cce6eee 100644
--- a/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+++ b/csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
@@ -957,6 +957,8 @@ namespace Google.ProtocolBuffers.TestProtos {
FOO1 = 1,
BAR1 = 2,
BAZ = 3,
+ FOO2 = 1,
+ BAR2 = 2,
}
public enum TestSparseEnum {
diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc
index 42c928f1..38b30863 100644
--- a/src/google/protobuf/compiler/csharp/csharp_enum.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_enum.cc
@@ -71,20 +71,18 @@ void EnumGenerator::Generate(io::Printer* printer) {
printer->Print(vars,
"$name$ = $number$,\r\n");
}
- printer->Outdent();
- printer->Print("}\r\n\r\n");
- // -----------------------------------------------------------------
- // TODO(jonskeet): Think about aliases!
- /*
for (int i = 0; i < aliases_.size(); i++) {
map<string, string> vars;
- vars["classname"] = descriptor_->name();
vars["name"] = aliases_[i].value->name();
- vars["canonical_name"] = aliases_[i].canonical_value->name();
+ vars["canonical_number"] = SimpleItoa(aliases_[i].canonical_value->number());
printer->Print(vars,
- "public static final $classname$ $name$ = $canonical_name$;\r\n");
- }*/
+ "$name$ = $canonical_number$,\r\n");
+ }
+
+ printer->Outdent();
+ printer->Print("}\r\n\r\n");
+
}
} // namespace csharp