diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-03-11 21:32:55 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-03-11 21:33:06 +0100 |
commit | ad01375558d3f276299d4690c95b94eff9ad8a8b (patch) | |
tree | ae9023dfbf1afd802a992d32592e0cdd03b8571a /modules/tools/c++ | |
parent | 2fac9606ec57bb12c89fb7b65a5364904411a72b (diff) |
tools: better error printing
Diffstat (limited to 'modules/tools/c++')
-rw-r--r-- | modules/tools/c++/c_gen_iface.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/tools/c++/c_gen_iface.hpp b/modules/tools/c++/c_gen_iface.hpp index a5d1de6..8bd702b 100644 --- a/modules/tools/c++/c_gen_iface.hpp +++ b/modules/tools/c++/c_gen_iface.hpp @@ -482,6 +482,27 @@ struct lang_bind<schema::Function<Input, Output>, binding::SyncC> { return eov; } } + /** + * Source + */ + { + auto eov = append_function_def(src, cfg, state, f_name); + if(eov.is_error()){ + return eov; + } + } + { + auto eov = lang_bind_helper::append_string(src, "{\n\tif(!input) return -1;\n\tif(!output) return -1;\n\t"); + if(eov.is_error()){ + return eov; + } + } + { + auto eov = lang_bind_helper::append_string(src, "return 0;\n}\n\n"); + if(eov.is_error()){ + return eov; + } + } return void_t{}; } |