Updated Branches:
  refs/heads/master 716454e36 -> 59a884b73

THRIFT-1794 C# asyncctp broken
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/59a884b7
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/59a884b7
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/59a884b7

Branch: refs/heads/master
Commit: 59a884b739f87e6a94a71a532e3dc073141385eb
Parents: 716454e
Author: Jens Geyer <[email protected]>
Authored: Sun Dec 16 20:04:19 2012 +0100
Committer: Jens Geyer <[email protected]>
Committed: Sun Dec 16 20:04:19 2012 +0100

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


http://git-wip-us.apache.org/repos/asf/thrift/blob/59a884b7/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 924d372..943445a 100644
--- a/compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/compiler/cpp/src/generate/t_csharp_generator.cc
@@ -47,10 +47,15 @@ class t_csharp_generator : public t_oop_generator
       (void) option_string;
 
       std::map<std::string, std::string>::const_iterator iter;
+
       iter = parsed_options.find("async");
       async_ = (iter != parsed_options.end());
       iter = parsed_options.find("asyncctp");
       async_ctp_ = (iter != parsed_options.end());
+      if (async_ && async_ctp_) {
+        throw "argument error: Cannot specify both async and asyncctp; they 
are incompatible.";
+      }
+
       iter = parsed_options.find("nullable");
       nullable_ = (iter != parsed_options.end());
 
@@ -982,7 +987,8 @@ void 
t_csharp_generator::generate_service_interface(t_service* tservice) {
     if(async_||async_ctp_) {
       indent(f_service_) <<
         function_signature_async(*f_iter) << ";" << endl;
-    } else {
+    }
+    if (!async_) {
       indent(f_service_) << "#endif" << endl;
     }
   }

Reply via email to