This patch fixes the ocaml generator to generate good code when the 'include' Thrift IDL directive is used.
Patch: Joel Raymont
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@
1084654 13f79535-47bb-0310-9956-
ffa450edef68
*/
void t_ocaml_generator::generate_deserialize_struct(ofstream &out,
t_struct* tstruct) {
+ string prefix = "";
+ t_program* program = tstruct->get_program();
+ if (program != NULL && program != program_) {
+ prefix = capitalize(program->get_name()) + "_types.";
+ }
string name = decapitalize(tstruct->get_name());
- out << "(read_" << name << " iprot)";
+ out << "(" << prefix << "read_" << name << " iprot)";
}