diff options
Diffstat (limited to 'src/bin/eolian/legacy_generator.c')
-rw-r--r-- | src/bin/eolian/legacy_generator.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c index 2a3ca705e9..feb53189f8 100644 --- a/src/bin/eolian/legacy_generator.c +++ b/src/bin/eolian/legacy_generator.c @@ -26,7 +26,7 @@ EAPI @#ret_type\n\ @#eapi_prefix_@#func(@#is_constEo *obj@#full_params)\n\ {\n\ @#ret_init_val\ - eo_do((Eo *) obj, @#eoprefix_@#func(@#eo_params));\n\ + eo_do((Eo *) obj, @#eo2_ret_assign@#eoprefix_@#func(@#eo_params));\n\ return @#ret_val;\n\ }\n\ "; @@ -297,20 +297,27 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi sprintf (tmp_ret_str, "%s%s", ret_const?"const ":"", rettype?rettype:"void"); if (rettype && !ret_is_void) { +#ifndef EO2 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", "); - Eina_Bool had_star = !!strchr(rettype, '*'); + eina_strbuf_append_printf(eoparam, "&%s", retname); +#endif const char *dflt_ret_val = eolian_function_return_dflt_value_get(funcid, ftype); + Eina_Bool had_star = !!strchr(rettype, '*'); sprintf (tmpstr, " %s%s%s%s = %s;\n", ret_const?"const ":"", rettype, had_star?"":" ", retname, dflt_ret_val?dflt_ret_val:"0"); - eina_strbuf_append_printf(eoparam, "&%s", retname); } eina_strbuf_replace_all(fbody, "@#full_params", eina_strbuf_string_get(fparam)); eina_strbuf_replace_all(fbody, "@#eo_params", eina_strbuf_string_get(eoparam)); eina_strbuf_replace_all(fbody, "@#ret_type", tmp_ret_str); eina_strbuf_replace_all(fbody, "@#ret_init_val", tmpstr); + tmp_ret_str[0] = '\0'; +#ifdef EO2 + if (rettype && !ret_is_void) sprintf(tmp_ret_str, "%s = ", retname); +#endif + eina_strbuf_replace_all(fbody, "@#eo2_ret_assign", tmp_ret_str); eina_strbuf_replace_all(fbody, "@#ret_val", (rettype && !ret_is_void) ? retname : ""); eina_strbuf_replace_all(fbody, "@#is_const", (ftype == GET || eolian_function_object_is_const(funcid)) ? "const " : ""); |