You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2013/05/02 19:31:07 UTC

git commit: THRIFT-1955 Union Type writer generated in C# does not WriteStructBegin

Updated Branches:
  refs/heads/master 1077ed678 -> d708ebb68


THRIFT-1955 Union Type writer generated in C# does not WriteStructBegin

Patch: Carl Yeksigian


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d708ebb6
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d708ebb6
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d708ebb6

Branch: refs/heads/master
Commit: d708ebb6890c58111f05db781927d07a5ce0e9f3
Parents: 1077ed6
Author: Jens Geyer <je...@apache.org>
Authored: Thu May 2 19:29:42 2013 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Thu May 2 19:29:42 2013 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_csharp_generator.cc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/d708ebb6/compiler/cpp/src/generate/t_csharp_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc
index f0972cf..90336a6 100644
--- a/compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/compiler/cpp/src/generate/t_csharp_generator.cc
@@ -1027,6 +1027,9 @@ void t_csharp_generator::generate_csharp_union_class(std::ofstream& out, t_struc
   indent(out) << "}" << endl;
   indent(out) << "public override void Write(TProtocol oprot) {" << endl;
   indent_up();
+  indent(out) << "TStruct struc = new TStruct(\"" << tunion->get_name() << "\");" << endl;
+  indent(out) << "oprot.WriteStructBegin(struc);" << endl;
+
   indent(out) << "TField field = new TField();" << endl;
   indent(out) << "field.Name = \"" << tfield->get_name() << "\";" << endl;
   indent(out) << "field.Type = " << type_to_enum(tfield->get_type()) << ";" << endl;