Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Thrift Wiki" for change 
notification.

The following page has been changed by HannesBaldursson:
http://wiki.apache.org/thrift/ThriftGeneration

------------------------------------------------------------------------------
   * Run thrift with the options for your language of choice. e.g. `thrift -php 
myproject.thrift`
   * Your files will be generated in a sub directory called e.g. `gen-php`
  
+ Note: Make sure you don't name variables the same as their datatype - you 
WILL run in to trouble. 
+ 
+ Consider this example BAD CODE:
+ {{{
+ #!/usr/local/bin/thrift -gen cpp
+ #
+ 
+ namespace cpp stuff
+ 
+ typedef i32 somevariable
+ 
+ service Example {
+ 
+        // Function that takes somevariable called somevariable and returns 
datatype somevariable  
+        somevariable regenerate(1:somevarable somevariable),
+ }
+ }}}
+ 
+ Though the Thrift compiler compiles this example successfully the generated 
code will NOT compile. 
+ 
+ Also note that using terms like "new" as a function name will cause errors in 
the generated code.
+ 

Reply via email to