felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ccd5441b8f3fae59ddb9d3dcd75cb00340c8278c

commit ccd5441b8f3fae59ddb9d3dcd75cb00340c8278c
Author: Lauro Moura <[email protected]>
Date:   Wed Aug 7 15:49:36 2019 -0300

    cxx: Fix funcptr c_args declaration.
    
    Summary:
    The internal wrapper was generating the argument types directly instead
    of passing through the translation generator `grammar::c_type`.
    
    This caused the type in the `caller` callback to be different from the
    actual C type of the declared function pointer, like in `@out` parameters.
    
    Reviewers: tasn, felipealmeida
    
    Reviewed By: felipealmeida
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D9524
---
 src/lib/eolian_cxx/grammar/type_function_declaration.hpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/eolian_cxx/grammar/type_function_declaration.hpp 
b/src/lib/eolian_cxx/grammar/type_function_declaration.hpp
index 71ca630f94..fcd094fdf5 100644
--- a/src/lib/eolian_cxx/grammar/type_function_declaration.hpp
+++ b/src/lib/eolian_cxx/grammar/type_function_declaration.hpp
@@ -56,10 +56,15 @@ struct type_function_declaration_generator {
 
       std::vector<std::string> c_args;
       for (auto itr : f.parameters)
-        c_args.push_back(", " + itr.type.c_type + " " + itr.param_name);
+        {
+           std::string arg;
+           if (!as_generator(grammar::c_type << " " << 
string).generate(std::back_inserter(arg), std::make_tuple(itr, itr.param_name), 
ctx))
+             return false;
+           c_args.push_back(arg);
+        }
       if (!as_generator(
              scope_tab << "static " << string << " caller(void *cxx_call_data"
-             << *(string) << ") {\n"
+             << *(", " << string) << ") {\n"
              << scope_tab << scope_tab << "auto fw = 
static_cast<function_wrapper<"
              << string << ", F, ::efl::eolian::" << string << 
"__function_tag>*>(cxx_call_data);\n"
              ).generate(sink, std::make_tuple(f.return_type.c_type, c_args, 
f.c_name, f.c_name), ctx))

-- 


Reply via email to