diff options
Diffstat (limited to 'modules/tools')
-rw-r--r-- | modules/tools/c++/c_gen_iface.hpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/modules/tools/c++/c_gen_iface.hpp b/modules/tools/c++/c_gen_iface.hpp index 353572a..cc06339 100644 --- a/modules/tools/c++/c_gen_iface.hpp +++ b/modules/tools/c++/c_gen_iface.hpp @@ -955,7 +955,7 @@ struct lang_bind<schema::Function<Input, Output>, binding::SyncC> { * Call the c++ implementation */ { - auto eov = lang_bind_helper::append_string(tpe.at(f_id).source, "\n\tauto eov = iface.template call<\""); + auto eov = lang_bind_helper::append_string(tpe.at(f_id).source, "\n\tauto eoc = iface.template call<\""); if(eov.is_error()){ return eov; } @@ -973,7 +973,28 @@ struct lang_bind<schema::Function<Input, Output>, binding::SyncC> { } } { - auto eov = lang_bind_helper::append_string(tpe.at(f_id).source, "\tif(eov.is_error()){\n\t\tauto& err = eov.get_error();\n\t\treturn err.get_code();\n\t}\n\tauto& cpp_output_root = eov.get_value();\n\n"); + auto eov = lang_bind_helper::append_string(tpe.at(f_id).source, "\tif(eoc.is_error()){\n\t\tauto& err = eoc.get_error();\n\t\treturn err.get_code();\n\t}\n\tauto& cpp_output_root = eoc.get_value();\n\n"); + if(eov.is_error()){ + return eov; + } + } + /** + * Translate back to C + */ + { + auto eov = lang_bind_helper::append_string(tpe.at(f_id).source, "\t{\n\t\tauto eov = "); + if(eov.is_error()){ + return eov; + } + } + { + auto eov = lang_bind_helper::append_hashed_type(tpe.at(f_id).source, cfg.prefix, schema_hash<Input>::apply()); + if(eov.is_error()){ + return eov; + } + } + { + auto eov = lang_bind_helper::append_string(tpe.at(f_id).source, "_translate_cpp_to_c(cpp_output_root, output);\n\t\tif(eov.is_error()) return eov.get_error().get_code();\n\t}\n"); if(eov.is_error()){ return eov; } |