thrift-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfarr...@apache.org
Subject svn commit: r1204495 - /thrift/trunk/compiler/cpp/src/generate/t_generator.cc
Date Mon, 21 Nov 2011 13:52:51 GMT
Author: jfarrell
Date: Mon Nov 21 13:52:51 2011
New Revision: 1204495

URL: http://svn.apache.org/viewvc?rev=1204495&view=rev
Log:
Thrift-1432: Javascript struct constants declared in the same file as their struct definition
will cause an error
Client: js
Patch: Mike Riley

Flips print out of constants and structs within the generator to allow for use of constants
within the structs.


Modified:
    thrift/trunk/compiler/cpp/src/generate/t_generator.cc

Modified: thrift/trunk/compiler/cpp/src/generate/t_generator.cc
URL: http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_generator.cc?rev=1204495&r1=1204494&r2=1204495&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_generator.cc Mon Nov 21 13:52:51 2011
@@ -45,10 +45,6 @@ void t_generator::generate_program() {
     generate_typedef(*td_iter);
   }
 
-  // Generate constants
-  vector<t_const*> consts = program_->get_consts();
-  generate_consts(consts);
-
   // Generate structs, exceptions, and unions in declared order
   vector<t_struct*> objects = program_->get_objects();
   vector<t_struct*>::iterator o_iter;
@@ -60,6 +56,10 @@ void t_generator::generate_program() {
     }
   }
 
+  // Generate constants
+  vector<t_const*> consts = program_->get_consts();
+  generate_consts(consts);
+
   // Generate services
   vector<t_service*> services = program_->get_services();
   vector<t_service*>::iterator sv_iter;



Mime
View raw message