summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/tools/c++/c_gen_iface.hpp21
-rw-r--r--modules/tools/tests/c_iface.cpp4
2 files changed, 25 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{};
}
diff --git a/modules/tools/tests/c_iface.cpp b/modules/tools/tests/c_iface.cpp
index 676b5de..01f981e 100644
--- a/modules/tools/tests/c_iface.cpp
+++ b/modules/tools/tests/c_iface.cpp
@@ -68,6 +68,7 @@ SAW_TEST("CIface Empty Interface"){
test_generate<schema::TestEmptyInterface>(res,src);
std::cout<<"\n"<<res<<"\n"<<std::endl;
+ std::cout<<"\nSource\n"<<src<<"\n"<<std::endl;
}
SAW_TEST("CIface One Function Interface"){
@@ -77,6 +78,7 @@ SAW_TEST("CIface One Function Interface"){
std::string src;
test_generate<schema::TestOneFunctionInterface>(res, src);
std::cout<<"\n"<<res<<"\n"<<std::endl;
+ std::cout<<"\nSource\n"<<src<<"\n"<<std::endl;
}
SAW_TEST("CIface Multi Function Interface"){
@@ -86,6 +88,7 @@ SAW_TEST("CIface Multi Function Interface"){
std::string src;
test_generate<schema::TestMultiFunctionInterface>(res, src);
std::cout<<"\n"<<res<<"\n"<<std::endl;
+ std::cout<<"\nSource\n"<<src<<"\n"<<std::endl;
}
SAW_TEST("CIface Array Function Interface"){
@@ -95,5 +98,6 @@ SAW_TEST("CIface Array Function Interface"){
std::string src;
test_generate<schema::TestArrayFunctionInterface>(res, src);
std::cout<<"\n"<<res<<"\n"<<std::endl;
+ std::cout<<"\nSource\n"<<src<<"\n"<<std::endl;
}
}