summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2018-01-12 18:45:13 +0900
committerThiep Ha <thiepha@gmail.com>2018-01-12 18:45:40 +0900
commit360ce182efa373598b39225a8458f8e36d110fe1 (patch)
tree95a19d639a883334fd5955706a036eae7164451e
parentf7d9f0dde6b7bf5aae1124682e59373572dd3f90 (diff)
eolian_cxx: support multiple function pointers
-rw-r--r--src/lib/eolian_cxx/grammar/converting_argument.hpp4
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp3
2 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/eolian_cxx/grammar/converting_argument.hpp b/src/lib/eolian_cxx/grammar/converting_argument.hpp
index c419d36b7c..6975743520 100644
--- a/src/lib/eolian_cxx/grammar/converting_argument.hpp
+++ b/src/lib/eolian_cxx/grammar/converting_argument.hpp
@@ -35,8 +35,8 @@ struct converting_argument_generator
35 attributes::qualifier_def qualifier = param.type.original_type.visit(attributes::get_qualifier_visitor{}); 35 attributes::qualifier_def qualifier = param.type.original_type.visit(attributes::get_qualifier_visitor{});
36 if (param.type.original_type.visit(this->is_function_ptr)) 36 if (param.type.original_type.visit(this->is_function_ptr))
37 { 37 {
38 // FIXME: This supports only one function pointer. 38 return as_generator("fw_" << param.param_name << "->data_to_c(), fw_" << param.param_name << "->func_to_c(), fw_"
39 return as_generator("fw->data_to_c(), fw->func_to_c(), fw->free_to_c()") 39 << param.param_name << "->free_to_c()")
40 .generate(sink, param, ctx); 40 .generate(sink, param, ctx);
41 } 41 }
42 else 42 else
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 16d15b6f24..baaa61382e 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -703,7 +703,6 @@ struct function_def
703 703
704 std::vector<std::string> opening_statements() const 704 std::vector<std::string> opening_statements() const
705 { 705 {
706 // FIXME: Supports only one function pointer
707 std::vector<std::string> statements; 706 std::vector<std::string> statements;
708 char template_typename = 'F'; 707 char template_typename = 'F';
709 for (auto const& param : this->parameters) 708 for (auto const& param : this->parameters)
@@ -714,7 +713,7 @@ struct function_def
714 { 713 {
715 char typenam[2] = { 0, }; 714 char typenam[2] = { 0, };
716 typenam[0] = template_typename++; 715 typenam[0] = template_typename++;
717 std::string statement = "auto fw = new ::efl::eolian::function_wrapper<"; 716 std::string statement = "auto fw_" + param.param_name + " = new ::efl::eolian::function_wrapper<";
718 statement += param.type.c_type + ", " + typenam + ">(" + param.param_name + ");"; 717 statement += param.type.c_type + ", " + typenam + ">(" + param.param_name + ");";
719 statements.push_back(statement); 718 statements.push_back(statement);
720 } 719 }