From: Jens Geyer Date: Sun, 16 Dec 2012 19:04:19 +0000 (+0100) Subject: THRIFT-1794 C# asyncctp broken X-Git-Tag: 0.9.1~225 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=59a884b739f87e6a94a71a532e3dc073141385eb;p=common%2Fthrift.git THRIFT-1794 C# asyncctp broken Patch: Carl Yeksigian --- diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc index 924d3725..943445a4 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::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; } }