diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-03-15 11:40:27 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-03-15 11:40:38 +0100 |
commit | 7dc6c28f72893dd428a4b5b39a34c5c6b85965a2 (patch) | |
tree | efbb0537c9a513983dae0a6d0a6a6d82c74f7281 /modules/tools | |
parent | 2a84e80df881785f104a06c026e1810c3cc50516 (diff) |
tools: Check for context
Diffstat (limited to 'modules/tools')
-rw-r--r-- | modules/tools/c++/c_gen_iface.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/tools/c++/c_gen_iface.hpp b/modules/tools/c++/c_gen_iface.hpp index f9018bb..64ac5a5 100644 --- a/modules/tools/c++/c_gen_iface.hpp +++ b/modules/tools/c++/c_gen_iface.hpp @@ -279,6 +279,9 @@ struct lang_bind<schema::Array<T,D>, binding::SyncC> { template<typename Input, typename Output> struct lang_bind<schema::Function<Input, Output>, binding::SyncC> { static error_or<void> append_function_def(buffer& buff, const language_binding_config& cfg, language_binding_state& state, const std::string_view& f_name){ + /** + * Generate the base function declaration + */ { auto eov = lang_bind_helper::append_string(buff, "int "); if(eov.is_error()){ @@ -377,6 +380,9 @@ struct lang_bind<schema::Function<Input, Output>, binding::SyncC> { constexpr uint64_t input_hash = schema_hash<Input>::apply(); constexpr uint64_t output_hash = schema_hash<Output>::apply(); + /** + * Function generations + */ { auto eov = lang_bind<Input, binding::SyncC>::generate(buff, src, cfg, state); if(eov.is_error()){ @@ -495,7 +501,7 @@ struct lang_bind<schema::Function<Input, Output>, binding::SyncC> { } } { - auto eov = lang_bind_helper::append_string(src, "{\n\tif(!input) return -1;\n\tif(!output) return -1;\n\t"); + auto eov = lang_bind_helper::append_string(src, "{\n\tif(!ctx) return -1;\n\tif(!input) return -1;\n\tif(!output) return -1;\n\t"); if(eov.is_error()){ return eov; } |