forked from enlightenment/efl
eolian_cxx: support multiple function pointers
This commit is contained in:
parent
f7d9f0dde6
commit
360ce182ef
|
@ -35,8 +35,8 @@ struct converting_argument_generator
|
||||||
attributes::qualifier_def qualifier = param.type.original_type.visit(attributes::get_qualifier_visitor{});
|
attributes::qualifier_def qualifier = param.type.original_type.visit(attributes::get_qualifier_visitor{});
|
||||||
if (param.type.original_type.visit(this->is_function_ptr))
|
if (param.type.original_type.visit(this->is_function_ptr))
|
||||||
{
|
{
|
||||||
// FIXME: This supports only one function pointer.
|
return as_generator("fw_" << param.param_name << "->data_to_c(), fw_" << param.param_name << "->func_to_c(), fw_"
|
||||||
return as_generator("fw->data_to_c(), fw->func_to_c(), fw->free_to_c()")
|
<< param.param_name << "->free_to_c()")
|
||||||
.generate(sink, param, ctx);
|
.generate(sink, param, ctx);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -703,7 +703,6 @@ struct function_def
|
||||||
|
|
||||||
std::vector<std::string> opening_statements() const
|
std::vector<std::string> opening_statements() const
|
||||||
{
|
{
|
||||||
// FIXME: Supports only one function pointer
|
|
||||||
std::vector<std::string> statements;
|
std::vector<std::string> statements;
|
||||||
char template_typename = 'F';
|
char template_typename = 'F';
|
||||||
for (auto const& param : this->parameters)
|
for (auto const& param : this->parameters)
|
||||||
|
@ -714,7 +713,7 @@ struct function_def
|
||||||
{
|
{
|
||||||
char typenam[2] = { 0, };
|
char typenam[2] = { 0, };
|
||||||
typenam[0] = template_typename++;
|
typenam[0] = template_typename++;
|
||||||
std::string statement = "auto fw = new ::efl::eolian::function_wrapper<";
|
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 + ">(" + param.param_name + ");";
|
||||||
statements.push_back(statement);
|
statements.push_back(statement);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue