Don't declare getStaticLimitedReflection if gen_reflection_limited_ is off.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665552 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc
index 7fad194..7cdd635 100644
--- a/compiler/cpp/src/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/generate/t_cpp_generator.cc
@@ -1353,18 +1353,20 @@
f_header_ <<
indent() << "virtual ~" << service_name_ << "If() {}" << endl;
- f_header_ <<
- indent() << "static void getStaticLimitedReflection" <<
- "(facebook::thrift::reflection::limited::Service & _return);" << endl;
- // TODO(dreiss): Uncomment and test this if we decide we need
- // a virtual function with this effect.
- //f_header_ <<
- // indent() << "virtual void getVirtualLimitedReflection" <<
- // "(facebook::thrift::reflection::limited::Service & _return) ";
- //scope_up(f_header_);
- //f_header_ <<
- // indent() << "getStaticLimitedReflection(_return);" << endl;
- //scope_down(f_header_);
+ if (gen_reflection_limited_) {
+ f_header_ <<
+ indent() << "static void getStaticLimitedReflection" <<
+ "(facebook::thrift::reflection::limited::Service & _return);" << endl;
+ // TODO(dreiss): Uncomment and test this if we decide we need
+ // a virtual function with this effect.
+ //f_header_ <<
+ // indent() << "virtual void getVirtualLimitedReflection" <<
+ // "(facebook::thrift::reflection::limited::Service & _return) ";
+ //scope_up(f_header_);
+ //f_header_ <<
+ // indent() << "getStaticLimitedReflection(_return);" << endl;
+ //scope_down(f_header_);
+ }
vector<t_function*> functions = tservice->get_functions();
vector<t_function*>::iterator f_iter;