summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2017-06-12 22:39:03 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:25:42 -0300
commit9cf2726fa9a4e80415e721fbe8944db41dd09dbe (patch)
tree4af0905d442112f43f7f8e53329772dac8272e5b
parent94c375238b89f45b432f107b6d511863c5614712 (diff)
eolian_mono: Declare native retvar with default
More preparation for the try/catch on native wrappers.
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_helpers.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index bb5891ec14..5c3f52c125 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -66,7 +66,7 @@ struct native_function_definition_generator
66 << scope_tab << scope_tab << "efl.eo.IWrapper wrapper = efl.eo.Globals.data_get(pd);\n" 66 << scope_tab << scope_tab << "efl.eo.IWrapper wrapper = efl.eo.Globals.data_get(pd);\n"
67 << scope_tab << scope_tab << "if(wrapper != null) {\n" 67 << scope_tab << scope_tab << "if(wrapper != null) {\n"
68 << scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble() 68 << scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble()
69 << "((" << string << "Inherit)wrapper)." << string 69 << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "_ret_var = " : "") << "((" << string << "Inherit)wrapper)." << string
70 << "(" << (native_argument_invocation % ", ") << ");\n" 70 << "(" << (native_argument_invocation % ", ") << ");\n"
71 << eolian_mono::native_function_definition_epilogue(*klass) 71 << eolian_mono::native_function_definition_epilogue(*klass)
72 << scope_tab << scope_tab << "} else {\n" 72 << scope_tab << scope_tab << "} else {\n"
diff --git a/src/bin/eolian_mono/eolian/mono/function_helpers.hh b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
index 459f4e6d74..c6c93deb03 100644
--- a/src/bin/eolian_mono/eolian/mono/function_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
@@ -47,7 +47,7 @@ struct native_function_definition_preamble_generator
47 << scope_tab << scope_tab << "//Function pointer wrappers\n" 47 << scope_tab << scope_tab << "//Function pointer wrappers\n"
48 << *(scope_tab << scope_tab << native_convert_function_pointer << "\n") 48 << *(scope_tab << scope_tab << native_convert_function_pointer << "\n")
49 << scope_tab << scope_tab << "//Return variable and function call\n" 49 << scope_tab << scope_tab << "//Return variable and function call\n"
50 << scope_tab << scope_tab << native_convert_return_variable 50 << scope_tab << scope_tab << scope_tab << native_convert_return_variable << "\n"
51 ).generate(sink, std::make_tuple(f.parameters, f.parameters, f.parameters, f.return_type), context)) 51 ).generate(sink, std::make_tuple(f.parameters, f.parameters, f.parameters, f.return_type), context))
52 return false; 52 return false;
53 53
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index e834401709..cba6bdd3c7 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -896,7 +896,9 @@ struct native_convert_return_variable_generator
896 bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const 896 bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const
897 { 897 {
898 if (ret_type.c_type != "void") 898 if (ret_type.c_type != "void")
899 return as_generator("var _ret_var = ").generate(sink, attributes::unused, context); 899 return as_generator(
900 type << " _ret_var = default(" << type << ");"
901 ).generate(sink, std::make_tuple(ret_type, ret_type), context);
900 return true; 902 return true;
901 } 903 }
902 904