felipealmeida pushed a commit to branch master.

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

commit 69975fc72d12dec339f9c0a9b2ce93d34265c599
Author: Felipe Magno de Almeida <[email protected]>
Date:   Wed Jul 31 18:26:34 2019 -0300

    eolian-cxx: Add special type tags to make function_wrapper specializations 
unique
    
    Reviewers: lauromoura, bu5hm4n, woohyun
    
    Reviewed By: lauromoura
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D9469
---
 src/lib/eolian_cxx/grammar/klass_def.hpp                 |  2 +-
 src/lib/eolian_cxx/grammar/type_function_declaration.hpp | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp 
b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 628e2166c5..c3c524c5b4 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -872,7 +872,7 @@ struct function_def
                char typenam[2] = { 0, };
                typenam[0] = template_typename++;
                std::string statement = "auto fw_" + param.param_name + " = new 
::efl::eolian::function_wrapper<";
-               statement += param.type.c_type + ", " + typenam + ">(" + 
param.param_name + ");";
+               statement += param.type.c_type + ", " + typenam + ", 
::efl::eolian::" + param.type.c_type + "__function_tag>(" + param.param_name + 
");";
                statements.push_back(statement);
             }
        }
diff --git a/src/lib/eolian_cxx/grammar/type_function_declaration.hpp 
b/src/lib/eolian_cxx/grammar/type_function_declaration.hpp
index 93ebe45940..71ca630f94 100644
--- a/src/lib/eolian_cxx/grammar/type_function_declaration.hpp
+++ b/src/lib/eolian_cxx/grammar/type_function_declaration.hpp
@@ -37,9 +37,9 @@ struct type_function_declaration_generator {
 
       if (!as_generator(
              "template <typename F>\n"
-             "struct function_wrapper<" << string << ", F> {\n"
+             "struct function_wrapper<" << string << ", F, struct " << string 
<< "__function_tag> {\n"
              << scope_tab << "function_wrapper(F cxx_func) : 
_cxx_func(cxx_func) {}\n"
-             ).generate(sink, f.c_name, ctx))
+             ).generate(sink, std::make_tuple(f.c_name, f.c_name), ctx))
         return false;
 
       if (!as_generator(
@@ -49,9 +49,9 @@ struct type_function_declaration_generator {
              << "private:\n"
              << scope_tab << "F _cxx_func;\n"
              << scope_tab << "static void deleter(void *data) {\n"
-             << scope_tab << scope_tab << "delete 
static_cast<function_wrapper<" << string << ", F>*>(data);\n"
+             << scope_tab << scope_tab << "delete 
static_cast<function_wrapper<" << string << ", F, ::efl::eolian::" << string << 
"__function_tag>*>(data);\n"
              << scope_tab << "}\n"
-             ).generate(sink, std::make_tuple(f.c_name, f.c_name), ctx))
+             ).generate(sink, std::make_tuple(f.c_name, f.c_name, f.c_name), 
ctx))
         return false;
 
       std::vector<std::string> c_args;
@@ -61,8 +61,8 @@ struct type_function_declaration_generator {
              scope_tab << "static " << string << " caller(void *cxx_call_data"
              << *(string) << ") {\n"
              << scope_tab << scope_tab << "auto fw = 
static_cast<function_wrapper<"
-             << string << ", F>*>(cxx_call_data);\n"
-             ).generate(sink, std::make_tuple(f.return_type.c_type, c_args, 
f.c_name), ctx))
+             << 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))
         return false;
 
       if (f.return_type != attributes::void_

-- 


Reply via email to