From 7dc6c28f72893dd428a4b5b39a34c5c6b85965a2 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 15 Mar 2024 11:40:27 +0100 Subject: tools: Check for context --- modules/tools/c++/c_gen_iface.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/tools/c++/c_gen_iface.hpp') 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, binding::SyncC> { template struct lang_bind, binding::SyncC> { static error_or 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, binding::SyncC> { constexpr uint64_t input_hash = schema_hash::apply(); constexpr uint64_t output_hash = schema_hash::apply(); + /** + * Function generations + */ { auto eov = lang_bind::generate(buff, src, cfg, state); if(eov.is_error()){ @@ -495,7 +501,7 @@ struct lang_bind, 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; } -- cgit v1.2.3