From 19590864723d5a423b75b4f06ad7005a0a93f475 Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Wed, 24 Jul 2024 16:15:38 +0200 Subject: Half implemented arrays. Issue being that the inner types are not handled properly --- modules/tools/c++/c_gen_iface.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules') diff --git a/modules/tools/c++/c_gen_iface.hpp b/modules/tools/c++/c_gen_iface.hpp index 4fa881c..590ee3f 100644 --- a/modules/tools/c++/c_gen_iface.hpp +++ b/modules/tools/c++/c_gen_iface.hpp @@ -858,12 +858,21 @@ struct lang_bind, binding::SyncC> { return eov; } } + { + auto eov = lang_bind_helper::append_string(tpe.at(id).source, " {\n\ttry{\n\t\tcpp_val = {c_val->length};\n\t}catch(const std::exception&){return saw::make_error();}\n\n\tfor(uint64_t i = 0u; i < cpp_val.size(); ++i){\n\t\tcpp_val.at(i).set(c_val[i]);\n\t}\n\n\treturn void_t{};\n}\n"); + if(eov.is_error()){ + return eov; + } + } { auto eov = lang_bind_helper::append_translation_func(tpe.at(id).source, cfg.prefix, false); if(eov.is_error()){ return eov; } } + { + auto eov = lang_bind_helper::append_string(tpe.at(id).source, " {\n\treturn saw::make_error();\n}\n"); + } { auto eov = lang_bind_helper::append_string(tpe.at(id).source, "\n}\n"); if(eov.is_error()){ -- cgit v1.2.3