aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-11 15:00:52 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-11 15:00:52 +0100
commit9e5439a9a3becff98c85bf342633c304e6b447b3 (patch)
tree7a4e13097af6c4cc992985786f5d399adcca3de3
parenteo: remove class functions from eo (diff)
downloadefl-devs/bu5hm4n/cpp-firework.tar.gz
-rw-r--r--src/bin/eolian/sources.c1
-rw-r--r--src/lib/eolian_cxx/grammar/function_definition.hpp24
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c15
3 files changed, 17 insertions, 23 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index b027b9879c..d2d179b824 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -775,6 +775,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
eina_strbuf_append_buffer(buf, params_full);
eina_strbuf_append(buf, ")\n");
eina_strbuf_append(buf, "{\n");
+ eina_strbuf_append_printf(buf, "%s();\n", eolian_class_c_get_function_name_get(cl));
if (rtp)
eina_strbuf_append(buf, " return ");
else
diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp b/src/lib/eolian_cxx/grammar/function_definition.hpp
index b3080e4c67..c502e13876 100644
--- a/src/lib/eolian_cxx/grammar/function_definition.hpp
+++ b/src/lib/eolian_cxx/grammar/function_definition.hpp
@@ -27,7 +27,7 @@ struct function_definition_generator
function_definition_generator(attributes::klass_name const& name)
: _klass_name(name)
{}
-
+
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& ctx) const
{
@@ -48,7 +48,7 @@ struct function_definition_generator
suffix = "INTERFACE";
break;
}
-
+
if(f.is_beta &&
!as_generator("#ifdef " << *(string << "_") << string << "_BETA\n")
.generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx)))
@@ -113,17 +113,19 @@ struct function_definition_generator
;
if(!as_generator(*(out_declaration))
.generate(sink, f.parameters, ctx)) return false;
-
+
if(!as_generator(scope_tab).generate(sink, attributes::unused, ctx)) return false;
-
+
if(f.return_type != attributes::void_
&& !as_generator(attributes::c_type({attributes::parameter_direction::in, f.return_type, "", attributes::documentation_def{}, f.unit})
<< " __return_value = "
).generate(sink, attributes::unused, ctx)) return false;
- std::string object_flag;
- if (f.is_static) object_flag = "_eo_class()";
- else object_flag = "_eo_ptr()";
+ std::tuple<std::string> params;
+ if (f.is_static)
+ params = std::make_tuple(f.c_name, f.parameters)
+ else
+ params = std::make_tuple(f.c_name, "_eo_ptr()", f.parameters)
if(!as_generator
(" ::" << string << "(" << string <<
@@ -138,7 +140,7 @@ struct function_definition_generator
)
)
<< ");\n"
- ).generate(sink, std::make_tuple(f.c_name, object_flag, f.parameters), ctx))
+ ).generate(sink, params, ctx))
return false;
auto out_assignments =
@@ -163,7 +165,7 @@ struct function_definition_generator
;
if(!as_generator(*(out_assignments))
.generate(sink, f.parameters, ctx)) return false;
-
+
if(f.return_type != attributes::void_
&& !as_generator(scope_tab << "return ::efl::eolian::convert_to_return< ::efl::eolian::return_traits<"
<< type(true) << ">::type>(__return_value);\n"
@@ -201,7 +203,7 @@ namespace type_traits {
template <>
struct attributes_needed<function_definition_generator> : std::integral_constant<int, 1> {};
}
-
+
struct function_definition_terminal
{
function_definition_generator operator()(attributes::klass_name name) const
@@ -209,7 +211,7 @@ struct function_definition_terminal
return function_definition_generator{name};
}
} const function_definition = {};
-
+
} } }
#endif
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index fc21307278..674d1f8f23 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -3827,24 +3827,15 @@ Dummy_MyInt _dummy_test_object_bypass_typedef(EINA_UNUSED Eo *obj, EINA_UNUSED D
/* Class Properties */
static int _dummy_test_object_klass_prop = 0;
-int _dummy_test_object_klass_prop_get()
+int _dummy_test_object_klass_prop_get(void)
{
- EINA_LOG_ERR("FAIL on GET");
- if (klass != dummy_test_object_class_get())
- {
- eina_error_set(EINVAL);
- return -1;
- }
+ EINA_LOG_ERR("FAIL on GET");
return _dummy_test_object_klass_prop;
}
void _dummy_test_object_klass_prop_set(int value)
{
- EINA_LOG_ERR("FAIL on SET");
- if (klass != dummy_test_object_class_get())
- {
- eina_error_set(EINVAL);
- }
+ EINA_LOG_ERR("FAIL on SET");
_dummy_test_object_klass_prop = value;
}